Changes between Version 28 and Version 29 of GraphicsAPI


Ignore:
Timestamp:
Nov 25, 2014, 3:48:11 PM (11 years ago)
Author:
Tom Goddard
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GraphicsAPI

    v28 v29  
    99* Drawing
    1010* View
     11* !OpenGLContext
    1112* Camera
    1213* Lighting
     
    3435== How the Graphical User Interface uses a View ==
    3536
    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.
     37The 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.
    3738
    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.
    4140* 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.
    4343
    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.
     44The 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()).
    4545
    4646== What Graphics APIs are Useful to Outside Developers? ==
     
    6969== Clean-up and Issues with Hydra graphics module ==
    7070
    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.
    7471* 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.
    7572* 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.