MainDocs:OpenGL

From ClanLib Game SDK

Not written yet. Why don't you do it? :-)

Need to explain GL and GL1.

Need to explain how to use custom GL


Some extra bits below ... may be useful here, or maybe not.


Take CL_Image for example: 1) It loads and decodes an image, uploading to an OpenGL texture (via CL_Texture) 2) When drawing via CL_Image API, ClanLib collects all calls (via CL_RenderBatcher) until there is a state change in the CL_GraphicContext. Then it batch draws the images in a single opengl call.

For CL_Image, that basically is it.

There is more detail, for example 1) Internally, If the image is already loaded (even in a differerent OpenGL context), reuse the texture via CL_SharedGCData 2) Ability to use multiple images in the same picture. 3) Internally, the render batcher drawing has a custom OpenGL shader that allows 3 OpenGL source textures to be used in the same batch. Useful drawing images and CL_Fonts

CL_Fonts, CL_Sprites also have been optimised like this.

CL_Texture is a raw OpenGL wrapper to the image.

If you already use OpenGL and already has custom optimisations in your code. There is no advantage or disadvantages in using clanGL