Acolyte of the Butterfly
Posts: 109 from 2013/12/5
Forget about -lgl. That's the way I did it and it works:
Just declare
Code:
Library *TinyGLBase=0;
GLContext *__tglContext=0;
after all the includes yourself.
(maybe that's all you need to do to successfully link via -lgl, I suppose you got linker and not compiler errors?!)
Then open TinyGL
Code:
TinyGLBase=(Library*)OpenLibrary("tinygl.library",0);
then create your window or screen, and then your context and bind it to your window/screen:
Code:
__tglContext=GLInit();
TagItem tags[] = {
{TGL_CONTEXT_WINDOW,window_handle},
// {TGL_CONTEXT_SCREEN,screen_handle},
{NULL,NULL}
};
GLAInitializeContext(__tglContext,tags);
And don't forget to call
Code:
GLAReinitializeContextWindowed(__tglContext,window_handle);
after you resized your window.