Class: SFML::Context
- Inherits:
-
Object
- Object
- SFML::Context
- Defined in:
- ext/window/context.c,
ext/window/context.c
Overview
A raw OpenGL context, usable off-screen or on a thread without a Window.
Class Method Summary collapse
-
.active_context_id ⇒ Integer
Returns the unique identifier of the currently active context on the calling thread, or 0 if none is active.
-
.extension_available?(name) ⇒ Boolean
Returns
trueif the OpenGL extensionnameis available in the currently active context. -
.function(name) ⇒ Integer
Returns the address of the OpenGL function
nameas an Integer, or 0 when it is not available.
Instance Method Summary collapse
-
#active=(value) ⇒ Boolean
Activates or deactivates this context as the current one on the calling thread.
-
#new ⇒ Context
constructor
Creates and activates a new OpenGL context on the current thread.
-
#settings ⇒ ContextSettings
Returns the settings this context was created with.
Constructor Details
#new ⇒ Context
Creates and activates a new OpenGL context on the current thread.
44 45 46 |
# File 'ext/window/context.c', line 44 static VALUE Context_initialize(VALUE self) { return self; } |
Class Method Details
.active_context_id ⇒ Integer
Returns the unique identifier of the currently active context on the calling thread, or 0 if none is active.
104 105 106 |
# File 'ext/window/context.c', line 104 static VALUE Context_active_context_id(VALUE klass) { return ULL2NUM(sfContext_getActiveContextId()); } |
.extension_available?(name) ⇒ Boolean
Returns true if the OpenGL extension name is available in the currently
active context.
57 58 59 |
# File 'ext/window/context.c', line 57
static VALUE Context_extension_available(VALUE klass, VALUE rb_name) {
return BOOL2RB(sfContext_isExtensionAvailable(StringValueCStr(rb_name)));
}
|
.function(name) ⇒ Integer
Returns the address of the OpenGL function name as an Integer, or 0 when
it is not available.
82 83 84 |
# File 'ext/window/context.c', line 82
static VALUE Context_get_function(VALUE klass, VALUE rb_name) {
return ULL2NUM((unsigned long long)(uintptr_t)sfContext_getFunction(StringValueCStr(rb_name)));
}
|
Instance Method Details
#active=(value) ⇒ Boolean
Activates or deactivates this context as the current one on the calling thread.
69 70 71 |
# File 'ext/window/context.c', line 69
static VALUE Context_set_active(VALUE self, VALUE rb_active) {
return BOOL2RB(sfContext_setActive(Get_Context_Struct(self), RTEST(rb_active)));
}
|
#settings ⇒ ContextSettings
Returns the settings this context was created with.
92 93 94 |
# File 'ext/window/context.c', line 92 static VALUE Context_get_settings(VALUE self) { return context_settings_to_rb(sfContext_getSettings(Get_Context_Struct(self))); } |