-
Notifications
You must be signed in to change notification settings - Fork 16
Development
chsc edited this page Jan 15, 2012
·
8 revisions
One package for each OpenGL version:
- gl21 package for OpenGL 2.1
- gl31 package for OpenGL 3.1 (without deprecaded functions)
- gl31d package for OpenGL 3.1 (with deprecated functions)
- ...
Group extensions by vendor:
-
GL_NV_register_combiners
,GL_NV_fence
,GL_NV_vertex_program
,GL_NV_???
, ... -> nv package. -
GL_ATI_map_object_buffer
,GL_ATI_vertex_attrib_array_object
,GL_ATI_???
, ... -> ati package. -
Same for
GL_EXT_???
,GL_ARB_???
, ...
Planned usage:
// Import pure OpenGL 3.1 + all ATI and EXT extensions ...`
import (`
"http://github.com/chsc/GoGL/gl31"`
"http://github.com/chsc/GoGL/nv" // Import all GL_NV_ extensions
"http://github.com/chsc/GoGL/ati" // Imoort all GL_ATI_ extensions
"http://github.com/chsc/GoGL/ext" // Imoort all GL_EXT_ extensions
)
...
// Init GL_EXT_framebuffer_multisample
if err := ext.InitFramebufferMultisample(); err != nil {
... // handle error
}
// Single context interface:
gl.Init()
gl.Clear(gl.COLOR_BUFFER_BIT)
// Multi context interface (future):
// make context 1 current
// ...
glctx1 := ext.LoadXYZExtensionByCurrentContext()
// make context 2 current
// ...
glctx2 := ext.LoadXYZExtensionByCurrentContext()
// do something with context 2:
glctx2.FooBar(...)
...
// make context 1 current
// ...
// do something with context 2:
glctx2.FooBar(...)
...