BRL.GLGraphics: Functions Source  


Functions

GLGraphicsDriverGet OpenGL graphics driver
GLGraphicsCreate OpenGL graphics
GLAdjustTexSizeHelper function to calculate nearest valid texture size
GLTexFromPixmapHelper function to create a texture from a pixmap
GLDrawRectHelper function to output a simple rectangle
GLDrawTextHelper function to output some simple 8x16 font text
GLDrawPixmapHelper function to draw a pixmap to a gl context
GLShareContextsEnable OpenGL context sharing

Function reference

Function GLGraphicsDriver:TGLGraphicsDriver()
ReturnsAn OpenGL graphics driver
DescriptionGet OpenGL graphics driver
Information The returned driver can be used with SetGraphicsDriver

Function GLGraphics:TGraphics( width,height,depth=0,hertz=60,flags=GRAPHICS_BACKBUFFER|GRAPHICS_DEPTHBUFFER )
ReturnsAn OpenGL graphics object
DescriptionCreate OpenGL graphics
Information This is a convenience function that allows you to easily create an OpenGL graphics context.

Function GLAdjustTexSize( width Var,height Var )
DescriptionHelper function to calculate nearest valid texture size
InformationThis functions rounds width and height up to the nearest valid texture size

Function GLTexFromPixmap( pixmap:TPixmap,mipmap=True )
ReturnsInteger GL Texture name
DescriptionHelper function to create a texture from a pixmap
Informationpixmap is resized to a valid texture size before conversion.

Function GLDrawRect( x,y,width,height )
DescriptionHelper function to output a simple rectangle
Information Draws a rectangle relative to top-left of current viewport.

Function GLDrawText( text$,x,y )
DescriptionHelper function to output some simple 8x16 font text
Information Draws text relative to top-left of current viewport.

The font used is an internal fixed point 8x16 font.

This function is intended for debugging purposes only - performance is unlikely to be stellar.

Function GLDrawPixmap( pixmap:TPixmap,x,y )
DescriptionHelper function to draw a pixmap to a gl context
Information Draws the pixmap relative to top-left of current viewport.

This function is intended for debugging purposes only - performance is unlikely to be stellar.

Function GLShareContexts()
DescriptionEnable OpenGL context sharing
Information Calling GLShareContexts will cause all opengl graphics contexts created to shared displaylists, textures, shaders etc.

This should be called before any opengl contexts are created.