Sign in to follow this  
h3ro

Using the GPU?

Recommended Posts

Hallo, Im working on a small game using a non-standard API. With this API I dont have access to any graphic acceleration (Not sure if that is the right term?) All of my graphic calculation is done with the normal CPU. This is starting to take up a lot of resources now, slowing down my game (Sprite rotation, alpha blending, blitting, clipping). Would it be possible to program the GPU to the graphic part of my game? If it is, can I use c++ or does it need some other language? Thanks, Ole Kristian

Share this post


Link to post
Share on other sites
Sorry about that.

Windows Vista 32bit with Visual Studio 2008.
The graphics card is a Gainward gForce 8600GTS

Share this post


Link to post
Share on other sites
GPUs are usually usually used via a graphics application programming interface (API) such as Direct3D or OpenGL. You don't get direct access to graphics registers or memory - instead, you upload geometry and textures to the card and issue simple commands in order to instruct it to draw your stuff.

D3D is natively implemented in C++, and OpenGL in C - thus, C++ is the best language available to directly talk with these interfaces. There are wrappers available for other languages, though.

Your card is capable to run in conjunction with Direct3D 10.0 API, which is very robust but still rare among non-developers. Direct3D 9 capability is very common among general population, and OpenGL baseline is implemented in basically any card purchased within last ten years.

If you want to use Direct3D, start here. For OpenGL, go here. Which one of these you should pick depends on your programming style and choice of target platforms. I recommend evaluating both.

Share this post


Link to post
Share on other sites
The API I am using is something that is created by my university. It is based on Direct X, but everything useful is taken out of it. So all my API does it file loading, and giving me a pointer to the screen memory.

I have read about people using the GPU to do raytracing, so I was thinking that maybe I could use the GPU to do some number crunching for me as well. Im not even sure if im on the right track here or if I am making sense, hence the post here at the beginners forum

Thanks for the replies so far

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this