hm, topic description is too short:D
well. first of all, i feel sorry for apex, having promised to provide stuff about extensions, and still haven't showed up anything.
short overall reason was, i was lieing in bed the last days, i hat fever, and flue, or how ever that stuff is called. all in all, i did not felt well.
but i was not not working! i've coded quite some stuff, nothing really impressive, but at least some code. i'm thinking of showing you a little on what i do/did during the next time, and one thing i'll show will of course be adding extensions, and, as well, discussing how useful/useless they are.
besides not feeling well i had actually quite a fun time. i even got a pic from me (yay!!). here it is: davepermen in the utopia on Partyguide. That pic is from last friday, sometimes at about 2:00 in the morning.. (Party from Thursday till friday..). Just to show you i'm alive, hehe.
a tiny snipped from my code, to make you feel great, here:
extern "C" int main(int argc,char* args[]) {
try {
Sdl sdl;
OpenIL openIL;
Timer timer;
System* system = new System;
Scene* scene = startScene();
system->setScene(scene);
system->resetVideoMode();
timer.reset();
while(true) {
scene->draw();
scene->update(timer.frameTime());
sdl.swapBuffers();
if(scene->handleEvents()==false) {
break;
}
timer.update();
}
delete system, system = 0;
} catch(Exception& e) {
std::cout<<"Exception: "<<e.what()<<std::endl;
std::system("PAUSE");
return boost::exit_exception_failure;
}
return boost::exit_success;
}
and to make the extension part part of the code: you want to know how to load some extension in three short steps?
Step 1:
find the extension specification. its on this page: Extension Registry. For Example GL_ARB_window_pos
Step 2:
Get it's important information, functions and constants. Functions are listed under
Quote
New Procedures and Functions
void WindowPos2dARB(double x, double y)
void WindowPos2fARB(float x, float y)
void WindowPos2iARB(int x, int y)
void WindowPos2sARB(short x, short y)
void WindowPos2dvARB(const double *p)
void WindowPos2fvARB(const float *p)
void WindowPos2ivARB(const int *p)
void WindowPos2svARB(const short *p)
void WindowPos3dARB(double x, double y, double z)
void WindowPos3fARB(float x, float y, float z)
void WindowPos3iARB(int x, int y, int z)
void WindowPos3sARB(short x, short y, short z)
void WindowPos3dvARB(const double *p)
void WindowPos3fvARB(const float *p)
void WindowPos3ivARB(const int *p)
void WindowPos3svARB(const short *p)
void WindowPos2dARB(double x, double y)
void WindowPos2fARB(float x, float y)
void WindowPos2iARB(int x, int y)
void WindowPos2sARB(short x, short y)
void WindowPos2dvARB(const double *p)
void WindowPos2fvARB(const float *p)
void WindowPos2ivARB(const int *p)
void WindowPos2svARB(const short *p)
void WindowPos3dARB(double x, double y, double z)
void WindowPos3fARB(float x, float y, float z)
void WindowPos3iARB(int x, int y, int z)
void WindowPos3sARB(short x, short y, short z)
void WindowPos3dvARB(const double *p)
void WindowPos3fvARB(const float *p)
void WindowPos3ivARB(const int *p)
void WindowPos3svARB(const short *p)
Quote
New Tokens
none
none
Step 3: Add them to your code. that means, for each function, create a function pointer, and load it. for each token, create a constant. Example function void WindowPos3svARB(const short *p):
void (*glWindowPos3svARB)(const short *p); // this comes globaly into some .cpp file
to actually load the function pointer, you use this. returns 0 if function is not found.
(void*&)glWindowPos3svARB = wglGetProcAddress("glWindowPos3svARB"); // the (void*&) is a great simple cast to not have to rewrite the function pointer again.. it would look else like this:
glWindowPos3svARB = (void (*)(const short *p))wglGetProcAddress("glWindowPos3svARB");
constants you add simply by defining them #define GL_SOME_CONST_ARB 0xSOMENUMBER, or enum { GL_SOME_CONST_ARB = 0xSOMENUMBER } or what ever way you like (const int GL_SOME_CONST_ARB = 0xSOMENUMBER anyone?)
and then you can use glWindowPos3svARB.
the short 3step way. hehe. you should do more. the most important is not how-to, but why-to, and why-not-to.
ask carmack about extensions. they are heaven and hell:D












