Changes between Version 28 and Version 29 of GraphicsAPI
- Timestamp:
- Nov 25, 2014, 3:48:11 PM (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
GraphicsAPI
v28 v29 9 9 * Drawing 10 10 * View 11 * !OpenGLContext 11 12 * Camera 12 13 * Lighting … … 34 35 == How the Graphical User Interface uses a View == 35 36 36 The View class handles OpenGL rendering. To use the View class a graphical user interface needs to create an opengl context and instruct View to draw periodically. Five functions that are part of the View class API are needed.37 The View class handles OpenGL rendering. To use the View class a graphical user interface needs to create an opengl context and instruct View to draw periodically. Here are the relevant APIs. 37 38 38 * make_opengl_context_current() - this is a window-system specific opengl call. It should create the OpenGL context when called the first time. 39 * swap_opengl_buffers() - this is a window-system specific opengl call that causes the rendered off-screen buffer to be shown on the screen. 40 * draw_if_changed() - called 60 times per second using a window system timer event. 39 * OpenGLContext instance - passed to the View constructor, subclassed to provide make_current() and swap_buffers() methods that are window-system specific operations. 41 40 * draw() - called on a window system exposure event, for example when the graphics window is deiconified. 42 * resize() - called when the user resizes the graphics window, for example using the mouse. 41 * draw(only_if_changed=True) - called 60 times per second using a window system timer event. 42 * resize(width,height) - called when the user resizes the graphics window, for example using the mouse. 43 43 44 The first two functions are provided by the window toolkit and passed to the View constructor as arguments. The last three functions are methods of View called by the GUI code. The user interface mouse modes code uses additional member of the View class, namely the Camera (v.camera), the window size (v.window_size), the pixel size in Angstroms (v.pixel_size()), and the session (v.session) for accessing the list of opened models.44 The OpenGL context is provided by the window toolkit and passed to the View constructor as an argument. The last three View methods are called by the GUI code. The user interface mouse modes code uses additional member of the View class, namely the Camera (v.camera), the window size (v.window_size), the pixel size in Angstroms (v.pixel_size()), and the object under the mouse (v.first_intercept()). 45 45 46 46 == What Graphics APIs are Useful to Outside Developers? == … … 69 69 == Clean-up and Issues with Hydra graphics module == 70 70 71 * Make the entire OpenGL module private, rename it from opengl to _opengl.72 * Currently the View class knows about the Session object. It needs to know about the models and logging messages.73 * The Camera class has code specific to Oculus Rift which should be moved to the oculus module outside graphics with suitable hooks in Camera.74 71 * Should the frame drawing loop be outside the View class? Checks if graphics update needed. The View class should perhaps only take care of rendering effects (shadows, silhouettes, depth cue, background color) and know about the Camera and Models. Currently it handles "new frame" callbacks. 75 72 * Need an API to switch the graphics into stereo mode which requires that the GUI replace the OpenGL context with stereo-capable one. 76 * Make sphinx documentation group attributes and methods of classes. Currently everything is alphabetically listed.73 * Make sphinx documentation group attributes and methods of classes.