Interface
HsGLContext
Description [src]
interface Hs.GLContext : GObject.Object
An interface defining an OpenGL context.
Cores should use hs_core_create_gl_context() within load_rom() to
create a context.
Frontends must implement Hs.FrontendInterface.create_gl_context and create a
context within it.
HsGLContext needs to be realized before being used, using
hs_gl_context_realize(). This can fail, for example if the core requested
an unavailable profile or version. If that happens, the core should try a
different configuration or software rendering if possible, before failing to
load entirely.
After that, the context needs to be resized using hs_gl_context_set_size().
This can be done at any time.
The core must render its output into the default framebuffer, provided by the
frontend and accessed with hs_gl_context_get_default_framebuffer(). The
framebuffer will have a color attachment, as well as depth and stencil
attachment according to the flags passed into create_gl_context().
Use hs_gl_context_get_proc_address() to retrieve OpenGL symbols if the
core doesn’t have a way to do it on its own.
After rendering each frame, the core must call
hs_gl_context_swap_buffers().
OpenGL core output will often be vertically flipped. Pass
HS_GL_FLAGS_FLIPPED flag when creating the context to let the frontend
know that this is the case.
Prerequisite
In order to implement GLContext, your type must inherit fromGObject.
Interface structure
struct HsGLContextInterface {
GTypeInterface parent;
gboolean (* realize) (
HsGLContext* self,
GError** error
);
void (* unrealize) (
HsGLContext* self
);
void (* set_size) (
HsGLContext* self,
guint width,
guint height
);
guint (* get_default_framebuffer) (
HsGLContext* self
);
gpointer (* get_proc_address) (
HsGLContext* self,
const char* name
);
void (* swap_buffers) (
HsGLContext* self
);
void (* set_interlacing) (
HsGLContext* self,
HsInterlacingMode mode
);
void (* set_overscan) (
HsGLContext* self,
HsBorder* overscan
);
void (* set_colorburst) (
HsGLContext* self,
float cycle_length,
float line_offset,
float field_offset
);
}
No description available.
Interface members
parent |
|
No description available. |
|
realize |
|
No description available. |
|
unrealize |
|
No description available. |
|
set_size |
|
No description available. |
|
get_default_framebuffer |
|
No description available. |
|
get_proc_address |
|
No description available. |
|
swap_buffers |
|
No description available. |
|
set_interlacing |
|
No description available. |
|
set_overscan |
|
No description available. |
|
set_colorburst |
|
No description available. |