Class: Fox::FXGLContext

Inherits:
FXId show all
Defined in:
rdoc-sources/FXGLContext.rb

Overview

A GL context is an object representing the OpenGL state information. Multiple GL context may share display lists to conserve memory. When drawing multiple windows, it may be advantageous to share not only display lists, but also GL contexts. Since the GL context is created for a certain frame-buffer configuration, sharing of GL contexts is only possible if the windows sharing the GL context all have the same GL visual. However, display lists may be shared between different GL contexts.

Instance Attribute Summary collapse

Attributes inherited from FXId

#app, #userData, #xid

Instance Method Summary collapse

Methods inherited from FXId

#create, #created?, #destroy, #detach, #runOnUiThread

Methods inherited from FXObject

#bind, #handle, #load, #save, subclasses

Constructor Details

#initialize(app, visual, other = nil) ⇒ FXGLContext

Construct an OpenGL context. If other is a reference to an existing FXGLContext, this context will share display lists with that other context. Otherwise, this context will use its own private display list.



21
22
# File 'rdoc-sources/FXGLContext.rb', line 21

def initialize(app, visual, other=nil) # :yields: theGLContext
end

Instance Attribute Details

#visualObject (readonly)

The visual Fox::FXGLVisual



15
16
17
# File 'rdoc-sources/FXGLContext.rb', line 15

def visual
  @visual
end

Instance Method Details

#begin(drawable) ⇒ Object

Make this OpenGL context current prior to performing OpenGL commands.



28
# File 'rdoc-sources/FXGLContext.rb', line 28

def begin(drawable); end

#endObject

Make this OpenGL context non-current.



31
# File 'rdoc-sources/FXGLContext.rb', line 31

def end(); end

#shared?Boolean

Return true if it is sharing display lists.

Returns:

  • (Boolean)


25
# File 'rdoc-sources/FXGLContext.rb', line 25

def shared?; end

#swapBuffersObject

Swap front and back buffer



34
# File 'rdoc-sources/FXGLContext.rb', line 34

def swapBuffers(); end

#swapSubBuffers(x, y, w, h) ⇒ Object

Copy part of backbuffer to front buffer [Mesa]



37
# File 'rdoc-sources/FXGLContext.rb', line 37

def swapSubBuffers(x, y, w, h); end