The most efficient “architecture” for a multi-level 2D application using OpenGL on iPhone?

I am working on an application for the iPhone OS, the main view of which is a two-dimensional representation of OpenGL (this is a subclass of the Apple EAGLView class, which basically creates an orthoprojective 2D environment) with which the user interacts directly.

Sometimes (not always) I would like to display some controls on top of this basic GL view - think of it as a Heads-Up display. Note that you can scroll / animate from the bottom of the baseline, while the controls should be fixed on the screen above.

I'm good at Cocoa's views in general, and I'm good at CoreGraphics, but I'm green with Open GL, and the EAGLView operations (and its relationship with CALayers) are pretty opaque to me. I'm not sure how to mix most effectively in other elements (read: best performance, least hassle, etc.). I know that as a last resort I can create and maintain geometry for all other controls and visualize them on top of my base geometry every time I draw / replace, and therefore just save everything that the user sees in one view. But I'm less sure about other methods, such as having another view on top (UIKit / CG or GL?), Or somehow creating other layers in my only view, etc.

If people were so kind as to write brief comments, if they had traveled along these roads before, or at least pointed me to documentation or discussion on this issue, I would greatly appreciate it.

Thank.

+3
source share
1 answer

Create your animated preview as usual. Relate it to the purpose of rendering. What does it mean? Well, usually when you draw polygons on the screen, you actually do it on a normal surface (primary surface), and that’s exactly what happens that ultimately comes out on the screen. Instead of rendering to the surface of the screen, you can render any old surface.

HUD. ? ?

, HUD , . . - HUD , . ?

, , , . , HUD . , , - , .

, , , , , .

HUD. , . , , . , - .

, , .

+3

Source: https://habr.com/ru/post/1727981/


All Articles