#include <gfxdevice.h>
Public Member Functions | |
| virtual bool | initialize ()=0 |
| initializes the gfxdevice | |
| virtual void | deinitialize ()=0 |
| deinitializes the gfxdevice | |
| virtual bool | setScreenMode (int width, int height, int bitdepth, bool fullscreen)=0 |
| sets the specified screenmode | |
| virtual const std::list< ScreenModeInfo * > & | getScreenModes ()=0 |
| returns a list of available screenmodes | |
| virtual bool | isScreenModeAvailable (int width, int height, int bitdepth)=0 |
| checks wheter the specified screenmode is available | |
| virtual void | setWindowTitle (const Yagl::String title)=0 |
| sets the window title in windowed mode | |
| virtual void | hideMouseCursor ()=0 |
| hides the mouse cursor | |
| virtual void | showMouseCursor ()=0 |
| shows the mouse cursor | |
| virtual void | swapBuffers ()=0 |
| presents the backbuffer on screen | |
| virtual bool | wasWindowCloseButtonPressed ()=0 |
| reports wheter the user clicked on the close button of the window | |
| virtual bool | isMethodImplemented (YAGL_GFX_CAPS method)=0 |
| returns wheter a certain method is implemented | |
| virtual void | set (int attribute, void *value)=0 |
| sets a backend dependent attribute/value/parameter | |
| virtual void | get (int attribute, void *value)=0 |
| returns a backend dependent attribute/value/parameter | |
| virtual GfxSurface * | createSurface ()=0 |
| creates a surface with the specified attributes | |
| virtual void | destroySurface (GfxSurface *surface)=0 |
| destroys the specified surface | |
| virtual void | destroyAllSurfaces ()=0 |
| destroys all Surfaces currently in use | |
| virtual GfxFont * | createFont ()=0 |
| this will create a font object | |
| virtual void | destroyFont (GfxFont *font)=0 |
| destroys the font object specified | |
| virtual void | destroyAllFonts ()=0 |
| destroys all font objects currently in use | |
Static Public Member Functions | |
| static GfxDevice & | getInstance () |
| returns a reference to the singleton instance of the device | |
Protected Attributes | |
| int | width_ |
| width of the currently set screenmode | |
| int | height_ |
| height of the currently set screenmode | |
| int | bitdepth_ |
| bitdepth of the currently set screenmode | |
this is the abstract interface all GfxDevice implementations have to fullfill either fully or partially. all Gfx devices should keep track of a attributes, width_, height_ and bitdepth_ of the current screenmode that is. all GfxDevice implementations have to be singletons that can be accesssed via a getInstance() method that will return a reference to the device singleton
|
|
this will create a font object this will create a font object. as a font is possibly dependant on the chose backend the GfxDevice should also serve as a factory for fonts the FBGFX backend font implementation would probably work differently to the GLFW backend font implementation. the former would store all glyphs in seperate bitmaps, the later might store all glyphs in one big texture. the gfxdevice implementation should also keep track of all created font objects as it does for the surface objects
|
|
|
creates a surface with the specified attributes this will create a surface with the specified attributes. as the backend is responsible for creating the surface it can chose to ignore the attributes specified. ( e.g. the opengl backend might not create anything at this call, just a GlGfxSurface instance. the actual creation of content would happen elsewhere. the FBGFX backend would ignore the bitdepth field as the created surfaces bitdepth would be set to the current screenmode bitdepth. the backend should also keep track of all created surfaces in order to be able to destroy all surfaces in use at program exit or device deinitialization
|
|
|
deinitializes the gfxdevice this will deinitialize the gfxdevice, possibly destroy any open window and delete all surfaces still alive. |
|
|
destroys all font objects currently in use this will destroy all font objects currently in use |
|
|
destroys all Surfaces currently in use this will destroy all surface currently in use. |
|
|
destroys the font object specified this will destroy the specified font object. the backend should keepp track of that
|
|
|
destroys the specified surface this will destroy the specified surface. the backend should also make sure that it is no longer in it's list of surfaces currently in use.
|
|
||||||||||||
|
returns a backend dependent attribute/value/parameter this is a gateway method that allows users to retrieve features of a certain backend. see the backend implementations of this to check what valid attributes you can get with a given backend
|
|
|
returns a reference to the singleton instance of the device this will return a reference to the singletons instance
|
|
|
returns a list of available screenmodes this will return a list of available screenmodes. use this if you want to enumerate all available screenmodes.
|
|
|
hides the mouse cursor this will hide the mouse cursor |
|
|
initializes the gfxdevice this will initialize all the gfxdevice related things and return true on success
|
|
|
returns wheter a certain method is implemented this returns wheter the specified method is implemented see the YAGL_GFXDEVICE_CAPS enum for values a backend only has to implement a subset of the functionality described in this abstract class and this method allows the user to enumerate what is implemented and what is not
|
|
||||||||||||||||
|
checks wheter the specified screenmode is available this will check wheter the specified fullscreen screenmode is available
|
|
||||||||||||
|
sets a backend dependent attribute/value/parameter this is a gateway method that allows users to enable features of a certain backend. see the backend implementations of this to check what valid attributes you can set with a given backend
|
|
||||||||||||||||||||
|
sets the specified screenmode this will set the specified screenmode. any surfaces created before a call to this function have to be converted into a proper format if needed! e.g. the FBGFX backend only allows surfaces to be used with the screensurface if they have an equal bitdepth, thus if you change from 16 to 24 bit this method would have to convert all surfaces to 24-bit in order to keep things working. with the opengl backend all textures would need to get reloaded. ( FIXME how could we do that the best way in opengl? the bitmaps are only stored in vram so we'd have to get them off of vram before changing the screenmode and temporarily save them somewhere, hd or ram maybe scary stuff... ). this should always setup a doublebuffered environment.
|
|
|
sets the window title in windowed mode this will set the title of the window in a windowed screenmode
|
|
|
shows the mouse cursor this will show the mouse cursor |
|
|
presents the backbuffer on screen this will present the frame in the backbuffer on screen. wheter this is accomplished via a simple flip or a complete memory copy is up to the backend. it should just make the doublebuffering system work |
|
|
reports wheter the user clicked on the close button of the window the window will not be closed
|
1.4.5