[−][src]Crate ogl33
Global GL loader and bindings for OpenGL 3.3 Core.
It was generated using gl_generator
, so it works basically like the gl
crate does.
use ogl33 as gl; gl::load_with(|ptr| SDL_GL_GetProcAddress(ptr)); gl::ClearColor(0.5, 0.5, 0.5, 1.0);
The main difference from the gl
crate is that this crate only loads
OpenGL 3.3 Core, not any other version of OpenGL. It might sound silly, but
not even having the other functions present in the crate while developing on
Windows or Linux helps to avoid relying on something that won't be there
when you go to make the Mac version.
Features
There's two features you can turn on. Both will print stuff to the console
if debug_assertions
are enabled.
debug_trace_messages
: If enabled, immediately before a call to a GL function it'll print the function's name. I expect that you'd keep this off most of the time, but if you're getting segfaults it might help to get a message before each GL call and hopefully you can spot the problem.debug_error_checks
: If enabled, immediately after all calls to GL there's an additional call toglGetError
. If the error value is something other thanNO_ERROR
then you'll immediately get an error message printed showing the name of the function, the arguments you passed, and the error code.
Unfortunately, the glDebugMessageCallback
function didn't become part of
Core until well after 3.3. However, even in 3.3 you can try the
ARB_debug_output
extension if you want to have additional debug messaging.
no_std
Support
This library is no_std
friendly! It's just bindings and loader callbacks
after all.
However, having either of the above features for message printing enabled
will cause the crate to link to the std
crate whenever
debug_assertions
are on. It's the price we pay for debugging messages.
Modules
Enums
__GLsync | |
_cl_context | |
_cl_event | |
c_void | Equivalent to C's |