Method: Glfw::Window#make_context_current

Defined in:
ext/glfw3/glfw3.c

#make_context_currentObject

Makes the window’s GL context current. You will need to call this before calling any OpenGL functions. See also ::unset_context to unset a context.

Wraps glfwMakeContextCurrent(window).

# Good
window.make_context_current()
Gl.glClear(Gl::GL_COLOR_BUFFER_BIT)

# Bad
Gl.glClear(Gl::GL_COLOR_BUFFER_BIT)
window.make_context_current()

Remember to make a window’s context current before calling any OpenGL functions. A window’s GL context may only be current in one thread at a time.



1444
1445
1446
1447
1448
# File 'ext/glfw3/glfw3.c', line 1444

static VALUE rb_window_make_context_current(VALUE self)
{
  glfwMakeContextCurrent(rb_get_window(self));
  return self;
}