Using GL extensions.

Just starting out? Need help? Post your questions and find answers here.
RonStyle
User
User
Posts: 10
Joined: Sat Jan 17, 2004 11:35 pm

Using GL extensions.

Post by RonStyle »

Hiya,

I wish to create my own 3d engine using gl, just wondering if/how
you use extensions in pb? (Nvidia specifically, and the obvious, like multi-texturing)

Thanks for any help :)
traumatic
PureBasic Expert
PureBasic Expert
Posts: 1661
Joined: Sun Apr 27, 2003 4:41 pm
Location: Germany
Contact:

Re: Using GL extensions.

Post by traumatic »

This link should get you started:
http://oss.sgi.com/projects/ogl-sample/registry/

After converting the necessary headerfiles you can use wglGetProcAddress_() *
to access the functions of the extensions.

Hope this helps.


* this is windows-specific, on linux it should be glXGetProcAddressARB_(),
but I don't know if it's implemented in the linux version (?)
Good programmers don't comment their code. It was hard to write, should be hard to read.
RonStyle
User
User
Posts: 10
Joined: Sat Jan 17, 2004 11:35 pm

Post by RonStyle »

[edit] Posted same time as you. Thanks, I'll take a look :) [/edit]

Perhaps I should re-phrase,
I don't need help on using the extensions themself(I.e how to code in gl)
but how do I Access them.
I've done it in C++, but I imagine PB can't load regular C++ headers?
traumatic
PureBasic Expert
PureBasic Expert
Posts: 1661
Joined: Sun Apr 27, 2003 4:41 pm
Location: Germany
Contact:

Post by traumatic »

I've done it in C++, but I imagine PB can't load regular C++ headers?
No, but you can convert the headers to PB.
In PB's Library SDK there's even a header-converter included.
This helps converting the #defines.

After that, you should be able to use the functions via dll-calls.
Good programmers don't comment their code. It was hard to write, should be hard to read.
traumatic
PureBasic Expert
PureBasic Expert
Posts: 1661
Joined: Sun Apr 27, 2003 4:41 pm
Location: Germany
Contact:

Re: Using GL extensions.

Post by traumatic »

Ah... and welcome to the forum! :)
Good programmers don't comment their code. It was hard to write, should be hard to read.
RonStyle
User
User
Posts: 10
Joined: Sat Jan 17, 2004 11:35 pm

Post by RonStyle »

So I grab and convert the wgExt.h and the h files for the extensions I need, convert those, and they become natural functions in PB?

(wipes tear away from eye, and jumps up and down on now useless VC6++ disc)

Thanks, had no idea about the converter :)
traumatic
PureBasic Expert
PureBasic Expert
Posts: 1661
Joined: Sun Apr 27, 2003 4:41 pm
Location: Germany
Contact:

Post by traumatic »

So I grab and convert the wgExt.h and the h files for the extensions I need, convert those, and they become natural functions in PB?
no, they won't be native commands, you just call the dll-functions.
well, you could write a library that wraps all that but it's still not really native... The DLL-Importer could also help you.
(wipes tear away from eye, and jumps up and down on now useless VC6++ disc)
don't :!:
just think of all the libraries you'll want to code :wink:
Good programmers don't comment their code. It was hard to write, should be hard to read.
Post Reply