1
votes

I am currently writing a simple graphics application in C++ that just shows a room and objects in the room. I want to make this render using the GPU of a computer, but how do I do this with broad compatibility (Meaning Nvidia, Intel and ATI, old and new cards). My computer uses an AMD/ATI chipset (instead of an integrated graphics card on the Mother Board, I have a GPU integrated into the processor die, called an APU instead of CPU, and a dedicated graphics card, also ATI). However, most likely the computer running the program will either have an integrated graphics card from Intel or Nvidia, or have an Nvidia card, so I want it be able to use any graphics card, but not use the CPU. I am using the glut library for this application

UPDATE: The real problem is that the professor seems to think that extra code is required for the program to use the graphics card as opposed to the processor to render the graphics. As I understand it now, all graphics cards support opengl regardless.

1
Mouse over your tag opengl for one answer.Eric J.
Ok, clarification. Turns out that what my professor meant was to use shaders to draw things instead of shapes. Makes a bit more sense, but still having difficulty with implementation of this.cluemein

1 Answers

3
votes

By using an abstract API that directs the drawing calls to the GPU's driver. OpenGL and Direct3D are just such APIs. Neither OpenGL nor DirectX are libraries. Yes you link to some library called libGL.so or opengl32.dll or d3dxxx.dll but these are just talking to the GPU's driver which will then direct the GPU to whatever it's been asked for through the API.

Or in other words: If your program is using OpenGL or DirectX and links against the standard interface libraries on the system (which is what happens by default), then it will work with whatever GPU there is, as long as its driver supports the API in question.