Context

Represents an OpenGL context. Creating context must be done before any other OpenGL object.

Members

Functions

clearCurrentBuffer
void clearCurrentBuffer()

Clears the currently bound buffer (either a frame buffer, or the front (screen) buffer if none are bound).

destroy
void destroy()
Undocumented in source. Be warned that the author may not have intended to support it.
disableCapability
void disableCapability(Capability capability)

Disables the capability.

enableCapability
void enableCapability(Capability capability)

Enables the capability.

enableVsync
void enableVsync(bool enable)

Enable or disable VSYNC. If enabled, updating the display will cause the calling thread to hang until a new frame starts. In other words, it will lock the updating rate to the display refresh rate.

getActualWindowSize
void getActualWindowSize(int* width, int* height)

Gets the window size actually being used. This can be different from the one that was set when running in full screen mode, or if it was bigger than the display.

getWindowHeight
uint getWindowHeight()

Returns the window height.

getWindowSize
void getWindowSize(int* width, int* height)

Gets the window size.

getWindowTitle
string getWindowTitle()

Returns the window title.

getWindowWidth
uint getWindowWidth()

Returns the window width.

isWindowCloseRequested
bool isWindowCloseRequested()

Returns true if an external process (such as the user) is requesting for the window to be closed. This value is reset once this method has been called.

newFrameBuffer
FrameBuffer newFrameBuffer()

Creates a new frame buffer.

newProgram
Program newProgram()

Creates a new program.

newRenderBuffer
RenderBuffer newRenderBuffer()

Creates a new render buffer.

newShader
Shader newShader()

Creates a new shader.

newTexture
Texture newTexture()

Creates a new texture.

newVertexArray
VertexArray newVertexArray()

Creates a new vertex array.

readFrame
ubyte[] readFrame(uint x, uint y, uint width, uint height, InternalFormat format)

Reads the current frame pixels and returns it as a byte buffer of the desired format. The size of the returned image data is the same as the current window dimensions.

setBlendingFunctions
void setBlendingFunctions(BlendFunction source, BlendFunction destination)

Sets the blending functions for the source and destination buffers, for all buffers. Blending must be enabled with {@link #enableCapability(org.spout.renderer.api.gl.Context.Capability)}.

setBlendingFunctions
void setBlendingFunctions(int bufferIndex, BlendFunction source, BlendFunction destination)

Sets the blending functions for the source and destination buffer at the index. Blending must be enabled with {@link #enableCapability(org.spout.renderer.api.gl.Context.Capability)}. <p/> Support for specifying the buffer index is only available in GL40.

setClearColor
void setClearColor(float red, float green, float blue, float alpha)

Sets the renderer buffer clear color. This can be interpreted as the background color.

setDepthMask
void setDepthMask(bool enabled)

Enables or disables writing into the depth buffer.

setFullScreen
void setFullScreen(bool fullscreen)

Enable or disable full screen mode. The window size will be changed to the desktop size when enabled, and back to the original size when disabled.

setResizable
void setResizable(bool resizable)

Sets the user resizability of this window. This doesn't do anything if the window is in full screen mode.

setViewPort
void setViewPort(uint x, uint y, uint width, uint height)

Sets the render view port, which is the dimensions and position of the frame inside the window.

setWindowSize
void setWindowSize(uint width, uint height)

Sets the window size. Will be limited to the desktop size.

setWindowTitle
void setWindowTitle(string title)

Sets the window title to the desired one.

updateDisplay
void updateDisplay()

Updates the display with the current front (screen) buffer.

Inherited Members

From Creatable

create
void create()

Creates the resources. It can now be used.

destroy
void destroy()

Releases the resource. It can not longer be used.

isCreated
bool isCreated()

Returns true if the resource was created and is ready for use, false if otherwise.

checkCreated
void checkCreated()

Throws an exception if the resource hasn't been created yet.

checkNotCreated
void checkNotCreated()

Throws an exception if the resource has been created already.

From GLVersioned

getGLVersion
GLVersion getGLVersion()

Returns the lowest OpenGL version required by this object's implementation.

Meta