GraphicsDevice

GraphicsDevice

class GraphicsDevice {}

Members

Functions

allocVertexBufferData
uint allocVertexBufferData(uint id, int size, void* data, BufferUsage usage)

Allocates and sends data to a vertex buffer object.

beginScene
void beginScene(Color color)

Begin drawing.

bindFrameBuffer
void bindFrameBuffer(uint id)

Binds a frame buffer.

bindFrameBuffer
void bindFrameBuffer(FrameBuffer frameBuffer)

Binds a vertex array object.

bindIndexBuffer
void bindIndexBuffer(uint id)

Binds an index array object.

bindTexture
void bindTexture(Texture texture, TextureTarget target)

Binds a texture.

bindTexture
void bindTexture(uint textureId, TextureTarget target)

Binds a texture.

bindVAO
void bindVAO(uint id)

Binds a vertex array object.

bindVertexBuffer
void bindVertexBuffer(uint id)

Binds a vertex buffer object.

clearTexture
void clearTexture(TextureTarget target)

Unbinds last used texture.

createBuffer
uint createBuffer(BufferType type, int size, void* data, BufferUsage usage)

Generates a buffer object and send data.

createFrameBuffer
T createFrameBuffer(int width, int height)

Creates a frame buffet object.

createIndexBuffer
uint createIndexBuffer(int size, void* data)

Creates an index buffer object.

createVertexBuffer
uint createVertexBuffer(int size, void* data, BufferUsage usage)

Creates a vertex buffer object.

deleteBuffer
void deleteBuffer(uint id)

Deletes a buffer object.

disable
void disable(uint target)

Disables GL capability.

disableShader
void disableShader()

Disables last used shader.

dispose
void dispose()

GraphicsDevice destructor.

drawCircle
void drawCircle(float deltaTime, vec3 position, uint radius)

Renders a circle.

drawIndexedPrimitives
void drawIndexedPrimitives(int count, void* offset)

Renders indexed primitives.

drawIndexedPrimitives
void drawIndexedPrimitives(int count, int offset)
Undocumented in source. Be warned that the author may not have intended to support it.
drawLine
void drawLine(vec3 a, vec3 b)

Renders a line.

drawPrimitives
void drawPrimitives(int count, int first)

Renders primitives.

drawText
void drawText(wstring text, float x, float y, color )

Renders text using default font. Params : text : text to draw x : y :

enable
void enable(uint target)

Enables GL capability.

enableShader
void enableShader(Shader shader)

Enables a shader for the next drawing operation.

generateBuffer
uint generateBuffer(BufferType type)

Generates a buffer object.

generateBuffers
uint[] generateBuffers(BufferType type, int count)

Generates multiple vertex buffer objects.

generateVAO
uint generateVAO()

Generates a vertex array object.

getScreenCoordinates
vec2 getScreenCoordinates(vec3 position)

Converts world coordinates to screen coordinates.

getWorldCoordinates
vec3 getWorldCoordinates(vec2 mousePosition)

Converts screen coordinates to world coordinates.

initialize2DProjection
void initialize2DProjection(T viewportSize)
Undocumented in source. Be warned that the author may not have intended to support it.
initialize2DProjection
void initialize2DProjection(V position, S viewportSize)
Undocumented in source. Be warned that the author may not have intended to support it.
initializeOrthographicProjection
void initializeOrthographicProjection(float left, float right, float bottom, float top, float near, float far)

Initializes an orthographic projection.

initializePerspectiveProjection
void initializePerspectiveProjection(float fov, float nearPlane, float farPlane)

Initializes a perspective projection.

reset2DProjection
void reset2DProjection()

Resets 2d projection (GUI) to the default value.

resetViewport
void resetViewport()

Resets viewport to its initial size.

sendVertexBufferData
uint sendVertexBufferData(uint id, uint offset, uint size, void* data)

Sends data to vertex buffer object.

setEnvironment
void setEnvironment()

Sets environment for the next render (lights, fog...).

setMatrix
void setMatrix(int location, U* data, size_t count, bool transposed)
Undocumented in source. Be warned that the author may not have intended to support it.
setProjectionMatrix
void setProjectionMatrix()

Sets default projection matrix.

setUniform
void setUniform(int uniformLocation, U* data, size_t count, bool normalized)

Sends values to current shader.

setUniform
void setUniform(int uniformLocation, U* data, size_t count)
Undocumented in source. Be warned that the author may not have intended to support it.
setUniform
void setUniform(int uniformLocation, U data)
Undocumented in source. Be warned that the author may not have intended to support it.
setVertexBuffer
void setVertexBuffer(uint id)

Binds a vertex buffer object for the next drawing operation.

setViewport
void setViewport(int width, int height)

Sets viewport.

setViewport
void setViewport(Size!int size)

Sets viewport.

setViewport
void setViewport(V position, Size!int size)

Sets viewport.

switchPolygonMode
void switchPolygonMode()

Switch display mode of vertices.

Mixins

__anonymous
mixin Singleton!()
Undocumented in source.

Properties

GUIprojectionMatrix
mat4 GUIprojectionMatrix [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
currentShader
Shader currentShader [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
defaultFont
Font defaultFont [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
defaultFont
Font defaultFont [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
environment
Environment environment [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
nvgContext
NVGcontext* nvgContext [@property getter]

Properties

projectionMatrix
mat4 projectionMatrix [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
projectionType
ProjectionType projectionType [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
resolution
const(Size!int) resolution [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
resolution
Size!int resolution [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
viewMatrix
mat4 viewMatrix [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
viewMatrix
mat4 viewMatrix [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
viewportSize
const(Size!int) viewportSize [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.

Meta