CoreGL

A really simple Demo illustrating OpenGL core profile with GtkD This example is provided under the terms of the GPL License.

@author sebastien.alaiwan@gmail.com

Constructors

this
this()
Undocumented in source.

Members

Functions

drawTriangle
void drawTriangle()
Undocumented in source. Be warned that the author may not have intended to support it.
initBuffers
void initBuffers(uint position_index, uint color_index)
Undocumented in source. Be warned that the author may not have intended to support it.
realize
void realize(Widget )
Undocumented in source. Be warned that the author may not have intended to support it.
render
bool render(GLContext c, GLArea a)
Undocumented in source. Be warned that the author may not have intended to support it.
unrealize
void unrealize(Widget )
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

m_Mvp
GLuint m_Mvp;
Undocumented in source.
m_Program
GLuint m_Program;
Undocumented in source.
m_Vao
GLuint m_Vao;
Undocumented in source.

Inherited Members

From GLArea

gtkGLArea
GtkGLArea* gtkGLArea;

the main Gtk struct

getGLAreaStruct
GtkGLArea* getGLAreaStruct(bool transferOwnership)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

getType
GType getType()
attachBuffers
void attachBuffers()

Ensures that the @area framebuffer object is made the current draw and read target, and that all the required buffers for the @area are created and bound to the frambuffer.

getAutoRender
bool getAutoRender()

Returns whether the area is in auto render mode or not.

getContext
GLContext getContext()

Retrieves the #GdkGLContext used by @area.

getError
ErrorG getError()

Gets the current error set on the @area.

getHasAlpha
bool getHasAlpha()

Returns whether the area has an alpha component.

getHasDepthBuffer
bool getHasDepthBuffer()

Returns whether the area has a depth buffer.

getHasStencilBuffer
bool getHasStencilBuffer()

Returns whether the area has a stencil buffer.

getRequiredVersion
void getRequiredVersion(int major, int minor)

Retrieves the required version of OpenGL set using gtk_gl_area_set_required_version().

getUseEs
bool getUseEs()

Retrieves the value set by gtk_gl_area_set_use_es().

makeCurrent
void makeCurrent()

Ensures that the #GdkGLContext used by @area is associated with the #GtkGLArea.

queueRender
void queueRender()

Marks the currently rendered data (if any) as invalid, and queues a redraw of the widget, ensuring that the #GtkGLArea::render signal is emitted during the draw.

setAutoRender
void setAutoRender(bool autoRender)

If @auto_render is %TRUE the #GtkGLArea::render signal will be emitted every time the widget draws. This is the default and is useful if drawing the widget is faster.

setError
void setError(ErrorG error)

Sets an error on the area which will be shown instead of the GL rendering. This is useful in the #GtkGLArea::create-context signal if GL context creation fails.

setHasAlpha
void setHasAlpha(bool hasAlpha)

If @has_alpha is %TRUE the buffer allocated by the widget will have an alpha channel component, and when rendering to the window the result will be composited over whatever is below the widget.

setHasDepthBuffer
void setHasDepthBuffer(bool hasDepthBuffer)

If @has_depth_buffer is %TRUE the widget will allocate and enable a depth buffer for the target framebuffer. Otherwise there will be none.

setHasStencilBuffer
void setHasStencilBuffer(bool hasStencilBuffer)

If @has_stencil_buffer is %TRUE the widget will allocate and enable a stencil buffer for the target framebuffer. Otherwise there will be none.

setRequiredVersion
void setRequiredVersion(int major, int minor)

Sets the required version of OpenGL to be used when creating the context for the widget.

setUseEs
void setUseEs(bool useEs)

Sets whether the @area should create an OpenGL or an OpenGL ES context.

addOnCreateContext
gulong addOnCreateContext(GLContext delegate(GLArea) dlg, ConnectFlags connectFlags)

The ::create-context signal is emitted when the widget is being realized, and allows you to override how the GL context is created. This is useful when you want to reuse an existing GL context, or if you want to try creating different kinds of GL options.

addOnRender
gulong addOnRender(bool delegate(GLContext, GLArea) dlg, ConnectFlags connectFlags)

The ::render signal is emitted every time the contents of the #GtkGLArea should be redrawn.

addOnResize
gulong addOnResize(void delegate(int, int, GLArea) dlg, ConnectFlags connectFlags)

The ::resize signal is emitted once when the widget is realized, and then each time the widget is changed while realized. This is useful in order to keep GL state up to date with the widget size, like for instance camera properties which may depend on the width/height ratio.

Meta