davepermen's Adventures

6ad5f8c742f1e8ec61000e2b0900fc76
0
davepermen 101 Apr 24, 2003 at 11:48

true yet.

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

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)

Constants under

New Tokens 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

5 Replies

Please log in or register to post a reply.

F7a4a748ecf664f189bb704a660b3573
0
anubis 101 Apr 24, 2003 at 17:23

party photos… very cool… i’ll try to get some of mine up

und gute besserung :)

6ad5f8c742f1e8ec61000e2b0900fc76
0
davepermen 101 Apr 24, 2003 at 19:44

ach mir gehts schon wieder soweit gut. bin heut wieder arbeiten gegangen, bin wieder fit und munter. jaja, hätt auch noch mehr picts. vielleich morgen wieder neues aus dem utopia

translation: i’m actually quite fine again, just wen’t to work today, and i’m full of energy and all the blahlbah (i can’t translate word by word!!!). and i would even have more pics, somewhere.. possibly tomorrow there’ll be new ones from the utopia.

we’ll see

grüsse nach rechtrheinland!!!

0684f9d33f52fa189aad7ac9e8c87510
0
baldurk 101 Apr 25, 2003 at 17:10

that’s really bad german! missing out ichs, endings all over the place

tut tut ;).

F7a4a748ecf664f189bb704a660b3573
0
anubis 101 Apr 26, 2003 at 00:05

baldurk : lol, depending on which part of the uk you’re from you shouldn’t be the one to complain about deformation of the own language :)

0684f9d33f52fa189aad7ac9e8c87510
0
baldurk 101 Apr 26, 2003 at 10:45

touche!