BRL.Graphics: | Globals | Functions | Modinfo | Source |
SetGraphicsDriver GLGraphicsDriver() Local g:TGraphics=CreateGraphics( 640,480,32,60,GRAPHICS_BACKBUFFER )Will create an OpenGL graphics object.
SetGraphics g 'we can now execute OpenGL code glClearColor .5,0,1,1 'tada! glClear 'yes! Flip 'must do this as the graphics is double bufferedOne you have finished with a graphics object, use CloseGraphics to close it.
Flags | Meaning |
---|---|
GRAPHICS_BACKBUFFER | Create graphics with a back buffer |
GRAPHICS_ALPHABUFFER | Create graphics with an alpha buffer |
GRAPHICS_DEPTHBUFFER | Create graphics with a depth buffer |
GRAPHICS_STENCILBUFFER | Create graphics with a stencil buffer |
GRAPHICS_ACCUMBUFFER | Create graphics with an accumulation buffer |
Global FlipHook | |
Description | Flip Hook id. |
Information | Use this id with AddHook to register a function that is called every Flip. |
Function CloseGraphics( g:TGraphics ) | |
Description | Close a graphics object. |
Information | Once closed, a graphics object can no longer be used. |
Function CountGraphicsModes() | |
Returns | Number of available Graphics modes. |
Description | Get number of graphics modes available under the current graphics driver. |
Information | Use GetGraphicsMode To obtain information about an individual Graphics mode. |
Function CreateGraphics:TGraphics( width,height,depth,hertz,flags ) | |
Returns | A graphics object. |
Description | Create a graphics object. |
Information | CreateGraphics creates a graphics object. To use this object for rendering, you will
first have to select it using SetGraphics. The kind of graphics object returned depends upon the current graphics driver as set by SetGraphicsDriver. |
Function EndGraphics() | |
Description | End graphics. |
Information | EndGraphics closes the graphics object returned by Graphics. |
Function Flip( sync=-1 ) | |
Description | Flip current graphics object. |
Information | Flip swap the front and back buffers of the current graphics objects. If sync is 0, then the flip occurs as soon as possible. If sync is 1, then the flip occurs on the next vertical blank. If sync is -1 and the current graphics object was created with the Graphics command, then flips will occur at the graphics object's refresh rate regardless of whether or not the graphics hardware supports such a refresh rate. If sync is -1 and the current graphics object was NOT created with the Graphics command, then the flip will occur on the next vertical blank. |
Function GetGraphicsMode( index,width Var,height Var,depth Var,hertz Var ) | |
Description | Get information about a graphics mode. |
Information | GetGraphicsMode returns information about a specific graphics mode. mode should be in the range 0 (inclusive) to the value returned by CountGraphicsModes (exclusive). |
Function Graphics:TGraphics( width,height,depth=0,hertz=60,flags=0 ) | |
Returns | A graphics object. |
Description | Begin graphics. |
Information | Graphics is a convenience function that simplifies the process of creating a graphics
object. Once Graphics has executed, you can begin rendering immediately without any need for SetGraphics. Graphics also enables PolledInput mode, providing a simple way to monitor the keyboard and mouse. |
Function GraphicsDepth() | |
Returns | The depth, in bits, of the current graphics object. |
Description | Get depth of current graphics object. |
Information | The current graphics object can be changed using SetGraphics. |
Function GraphicsFlags() | |
Returns | The flags of the current graphics object. |
Description | Get flags of current graphics object. |
Information | The current graphics object can be changed using SetGraphics. |
Function GraphicsHeight() | |
Returns | The height, in pixels, of the current graphics object. |
Description | Get height of current graphics object. |
Information | The current graphics object can be changed using SetGraphics. |
Function GraphicsHertz() | |
Returns | The refresh rate, in frames per second, of the current graphics object. |
Description | Get refresh rate of current graphics object. |
Information | The current graphics object can be changed using SetGraphics. |
Function GraphicsModeExists( width,height,depth=0,hertz=0 ) | |
Returns | True if a matching graphics mode is found. |
Description | Determine if a graphics mode exists. |
Information | A value of 0 for any of width, height, depth or hertz will cause that parameter to be ignored. |
Function GraphicsModes:TGraphicsMode[]() | |
Returns | An array of TGraphicsMode objects. |
Description | Get graphics modes available under the current graphics driver. |
Information | A TGraphicsMode object contains the following fields: width, height, depth and hertz. |
Example | Print "Available graphics modes:" For mode:TGraphicsMode=EachIn GraphicsModes() Print mode.width+","+mode.height+","+mode.depth+","+mode.hertz Next |
Function GraphicsWidth() | |
Returns | The width, in pixels, of the current graphics object. |
Description | Get width of current graphics object. |
Information | The current graphics object can be changed using SetGraphics. |
Function SetGraphics( g:TGraphics ) | |
Description | Set current graphics object. |
Information | SetGraphics will also change the current graphics driver if g uses a different driver than the current driver. |
Function SetGraphicsDriver( driver:TGraphicsDriver,defaultFlags=GRAPHICS_BACKBUFFER ) | |
Description | Set current graphics driver. |
Information | The current graphics driver determines what kind of graphics are created when you use
the CreateGraphics or Graphics functions, as well as the graphics modes available. The GLGraphicsDriver, GLMax2DDriver and D3D7Max2DDriver functions can all be used to obtain a graphics driver. The defaultFlags parameter allows you to specify graphics flags that will be applied to any graphics created with CreateGraphics or Graphics. |
Example | SetGraphicsDriver GLMax2DDriver() Graphics 640,480 DrawText "OpenGL Max2D Graphics! Hit any key (next to the whatever key)...",0,0 Flip WaitKey EndGraphics SetGraphicsDriver GLGraphicsDriver() Graphics 640,480 glClear GL_COLOR_BUFFER_BIT GLDrawText "'Raw' OpenGL Graphics! Hit any key...",0,0 Flip WaitKey |
Version | 1.08 |
---|---|
Author | Mark Sibly |
License | Blitz Shared Source Code |
Copyright | Blitz Research Ltd |
Modserver | BRL |
History | 1.08 Release |
History | Mouse repositioned only in fullscreen mode |
History | 1.07 Release |
History | Flip mode for attached graphics changed to 0 |
History | 1.06 Release |
History | Fixed softsync period init bug |
History | 1.05 Release |
History | Fixed softsync routine to prevent overflow |
History | 1.04 Release |
History | Graphics exceptions now caught |
History | 1.03 Release |
History | Added DefaultGraphicsFlags() Function |
History | 1.02 Release |
History | Restored FlipHook |
History | 1.01 Release |
History | Added default flags to SetGraphicsDriver |