Hi,
I’ve been seeing a lot of posts on the web about Gallium3D, but I’m not really sure how it is working (especially Direct3D part). The only thing I understand is that if I run a Direct3D game through Wine I can get native rendering if I got supporting graphic card drivers on Linux.
What I’d like to know is how to write a simple Direct3D program in C on Linux that will use Gallium3D. I tried to google it, but found nothing.
You don’t need to worry about Gallium. It’s an API for driver development not application development. The open-source graphics drivers like the r600 and nouveau use Gallium. As far as I know, Wine has a Direct3D implementation that’s layered on top of OpenGL so there’s no real native support.
Excuse my french, but why the hell do you want to write a Direct3D app on Linux? Of course you can and then try to run it using Wine but why would you want to? O_o
I’m just exploring possibilities of writing 3d rendering software which is OS independent.
I’m actually a great fan of OpenGL but when it comes to Windows, I get mad when trying to make it work with fragment shaders. I tried googling for a method how to get latest OpenGL 4.2 (or at least 3.2) functions to work but neither of them works actually.
When you find article about how to make it work, it usually has dozens of replies of angry people saying it doesn’t work for them…
Everything has "dozens of replies of angry people saying it doesn’t work for them… " That doesn’t mean it doesn’t actually work.
I’d say a good 75% of them are people who didn’t read the instructions or are otherwise following them improperly. 20% are likely people who haven’t updated their drivers or otherwise have hardware that can’t run the GL version they’re using. From there, you get maybe 5% at most who are having actual problems.
For GL development one of the simplest ways to use GL functionality is using some extension loader. The most popular one is GLEW which has basic usage tutorials on its website. All you need to do in addition is link to OpenGL32.lib (sort of like -lGL for g++). Note that GLEW doesn’t give any ways to create a valid GL context! What windowing toolkit do you intend to use?
I remember that most tutorials for windows were about including glext.h and then calling wglGetProcAddress to get pointers to functions above OpenGL 1.1. The problem was that wglGetProcAddress always returned NULL to me.
Is glext.h necessary when using GLEW?