cocoa - Best way to create an MVC paradigm using OpenGL? -


i beginning learn opengl development, using mac os x , cocoa and/or cgl api's, use classes examples, question more design rather particular implementation. here's situation:

i have 'scene' object, can contain or reference data render itself, , responds 'render' message draw itself, without transformations.

i have nsview or nsopenglview object creates openglcontext , pixelformats, resizes view, , updates modelview , projection based on transformations passed it. view object contains camera struct basis opengl transformations.

i have controller object nsresponder object, , responds user inputs.

i don't know if best arrangement; 'model' in case should scene, , suppose classically controller should mediate action between model , view, seems odd view send [[controller scene] render] every time wants draw view.

and not sure if best place 'camera' in view. should have scene object include camera looking @ it, , have respond ui input controller, passed view?

or wrong approach altogether? trying shoehorn mvc isn't meant it. curious sort of design patterns people out there use opengl.

i see way described. view designed control view point , projection, keeping camera reference in logical. scene, on other side, works pure data container me, not touching rendering methods, contrary model.


Comments

Popular posts from this blog

jQuery clickable div with working mailto link inside -

WPF: binding viewmodel property of type DateTime to Calendar inside ItemsControl -

java - Getting corefrences with Standard corenlp package -