Yeah, if you don't care about being cross platform, you can use DirectX. OpenGL is another option.
Don't use DirectX if you're new to C++. I couldn't understand DirectX until I'd been using C++ for over two years. I never programmed in any other language before learning C++, but still. DirectX is definately not for the inexperienced.
You might look into OpenGL, it's simpler and more straightforward. If you use GLUT, you won't even have to worry about win32. My advice is: learn C++ very well before worrying about graphics. Then learn to use OpenGL or Direct3D, and if you want to make useful applications with one of these, you'll need a good understanding of Win32 as well. Lastly, if you want to be able to do anything competently with graphics, you're going to need to understand the math behind it. Become familiar with vectors, dot and cross products, projections, matrices, matrix multiplication, linear transformations (and specific types of them), and orthographic and perspective projections. I think that's enough homework for now .
Cg is a shading language. I believe it is exclusively for writing shaders, which are small programs executed entirely on the video card for modifying vertices or pixels. It's not a graphics API like DirectX, you can't use it to render a scene, and you have to use DirectX or OpenGL to load and set the shader. Shaders are pretty simple to write, although I haven't done too much with them myself, and Cg and HLSL (another shading language) are very similar to C as you mentioned. But sedj is right: don't try graphics programming until you are comfortable with the language normally.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.