How do I start in graphics programming???


#4

The Visual C++ 2003 optimising compiler is free for download of the microsoft site. They also have the beta of the 2005 IDE available for free download. Only thing then left is the debugging tools, platform SDK, .NET SDK, DirectX SDK, all of which can be downloaded for free. (links via link below). Saves yourself some cash for the full on pro Visual C++ Setup…

gluts probably the easiest starting point, though longterm, the Win32 nehe framework would be more beneficial…

some links to get you started


#5

Mind if I join the discussion? This seems interesting to me too.

Rather than getting tutorials off the web, what would you guys recomend as books to get to learn graphics programming from? I am interested in game programming (desktop), but I don’t know whether I want to go for openGL or DirectX. I am already learning C++ from this book, and math from this one. I would think I need a very beginner book, so whatever book you know that is best for learning would probably be more important than opengl vs directx right now. Although, if the site is better than any book, then I should probably go with that :).

Oh, and for OpenGl, where would I get the sdk/glut? Thanks.


#6

The problem I got is that I don´t know how to add a library in my visual microsoft enviroment,
can you tell me how, or show me any tutorial for it?
thanks.


#7

I’m working in a Visual Studios 6 environment, so apologies if my ‘walkthrough’ doesn’t match your environment.

Whenever I add a library, I:

“Tools” -> “Options…”

Click on the “Directories” tab

Add the directory where the new lib’s include files are held.

Click on the pull down called “Show directories for:” and select “Library Files”

Add the directory where the “*.lib” files for your library are held, and do the same for any source files should the library come with them.

Hope that this helps,
Pete.


#8

MSDN is your friend

this is the subsection handling compiling & linking … via the menubar on the left you may get back to other sections that may of interest to you as well


#9

Thanks very much, that was very useful cause I got the 6 version too.

I will be asking as doubts come.


#10

Can anyone provide me with the gltk library?
cause I don´t find it on the net.


#11

A Google search for “GLTK” comes up with this site third on the list…

Unless you mean GLUT? In which case, the first google link is the one you’re after…


#12

To answer your question, starting with the sticky at the top of the page might have
helped :wink:

See my post on this thread

for a link to an

OpenGL/GLUT tutorial.

There is a wealth of info in this one thread alone.

Hope this points you in the right direction.


#13

You can also find the GLUT libraries at www.opengl.org. :slight_smile:


#14

Thanks thalaxis, I went to the page but when I try to open a sample in microsoft visual studio, it says that it cannot start the glut32.lib, so to say, I get you a picture. Please see if you can help me with this one, I wanna compile something in 3d…


#15

Did you make sure you added the glut32.lib to the project options? On project properties panel, there’s a linker options page.

This part I’m not too sure about, because I haven’t done it in a while, and I don’t have VC in front of me right now (I’m on a Linux box at work). Basically, one of the parameters on that page is a list of directories that the linker will look in for .lib files. Make sure one of them points to a directory containing glut32.lib. You can do that either by putting a copy of glut32.lib in a directory already on the list, or by adding an entry, it really doesn’t matter which one you choose as far as the linker’s concerned, but I generally prefer to add an entry.

Obviously, you have to make sure that you have the glut32 stuff compiled into a statically linked library for this to work.

Another option is to compile (or download) a .dll version of it, in which case all you need to do is either add it to your PATH or add the directory it’s in to the list in project options… I THINK you can add it to the same list as for the .lib, but I’ll have to take a look at it it to be sure.

I hope that helps!


#16

Hi

I’m in a similar boat here, I’m trying to learn graphics programming using the Cg language. Now I’m quite clear on how to write the actual shader programs, my problem is actually writing the simple applications that use these programs. All the examples I have found use OpenGL as part of the application, as well as the Cg shaders. This is OK, as I am currently learning OpenGL in uni, but I was wondering if it is necessary, and also if anyone can give me an idea of what I have to do in my application? Can anyone recommend any books or tutorials that teach you how to set up this kind of application, as everything I have found basically refers to the functions for loading a Cg program into your application, but not actually how to use it?

Thanks
Twib


#17

Tricks of the 3D Game Programming Gurus-Advanced 3D Graphics and Rasterization
by André LaMothe

Tricks of the Windows Game Programming Gurus (2nd Edition)
by André LaMothe

You guys might want to try the books above. I read the 2d version and it’s pretty nice. He explains how to make your own windows without GLUT. Instead you use straight windows API, which is good since you’ll have more control. I think in the 3d version he explains how to write your own software 3d engine (ie your own OpenGL). Plus, he explains all the math involve and the language he uses won’t bore you. Oh, of course he explains how to program games on your pc, the control structures involved, and more.


#18

Thanks, I now have one of those books, with the other one in the post. I have made slight progress since my last post, but I’m afraid I now have another cry for help! OK I have found out how I write a very simple C program that uses OpenGL and Cg to display a simple model. However all I get when I run the program is a blank window. The programs I have just use a very simple passthrough shader for both vertex and fragment, that I have written in Cg. Both of these should work or at least do something, as I test compiled them with the Cg compiler, to produce no errors. I also know that my C program is OK as if i take out the Cg shaders it just uses the OpenGL inbuilt pass throughs and displays what it is ment to. I have tried to use both Visual C++, and the command prompt to run the program, MSVC++ gives me the blank screen, while the command prompt doesn’t recognise either glut or Cg just giving compile time errors, dispite the fact I tried to setting some environment variables. Clearly something hasn’t been setup, or hasn’t been setup right, but I’m pulling my hair out trying to figure out what! I’d be very greatful to anyone who could offer any help/suggestions on this.

Many Thanks
Twib


#19

hey Twib!

how does your command line instruction look like? Usually you have to type your lib as well as the compile function. On Windows something like:

cl my_prog.c glut32.lib

For VC++ i recommend always to have a look at http://nehe.gamedev.net. You can compare your app with that one’s of the site to find out what’s wrong.


#20

I think some of you should stop and sit back and ask yourself what you want out of “graphics programming”. It is a broad field and as such, some approaches may be more desirable than others. If you want to learn realtime graphics programming, then by all means start with a graphics API like OpenGL or Direct3D. However, this doesn’t give you much theory about graphics in general. Since most of you know C/C++, getting the hang of any graphics API will be trivial.

What the “real” meat is in graphics programming is knowing about the entire graphics pipeline and the countless algorithms to achieve the things that are done using graphics programming. In this regard, the scope becomes much larger and will require mastery of several math concepts. I would recommend reading and with reading understanding before doing the trivial tasks of getting a window and pushing some triangles through the renderer to get a quick realtime render.

Cheers,

-M


#21

Hey

I finally managed to sort my Visual C++ problem! Thanks for the
suggestion raoul_duke I didn’t know that you could specify the
libraries at the command prompt like that (I haven’t really used C
that much before, as I was taught to program in Java) I will try it
out next time I am on my own PC. Thanks as well to Shaderhacker, but
rest assured this is exactly what I have done, it is only after lots
of studying of shader programming that this problem has come up. I
was only trying to learn how to get my C applications to use Cg
shaders with this very simple example, so that I could then apply what
I have learned. The studying is still ongoing as this is part of my
dissertation project at uni, as well as reading about animation
techniques etc, so thanks to 201 as well, the 3D game programming
gurus book arrived a few days ago, it looks to be quite useful, so
thanks for that recommendation!

Thanks guys
Twib


#22

I think there is something to be gained from starting from first principles and implementing your own basic 3D engine with at least back face removal, basic texture mapping and say phong shading - including implementing your own scanline algorithms etc. You don’t need to take it any further (because you’ll spend the rest of your life doing it) but being able to have a couple of simple meshes spinning, drawn in solid, mapped and shaded without calling OpenGL, DirectX etc pays real dividends as you progress in your career. It’s a little like knowing enough assembly language when you’re faced with a crash and no PDBs (symbols), or the crash is down in OleAut32 and you don’t have the symbol server installed, you are able to cope.

There are zillions of books of the nature of “So You Want To Implement Your Own Game Engine” that don’t use DirectX or OpenGL. Spend some time in a book store with a coffee and find one you like and then, and work through it - don’t just build the code that comes on the CD.

I don’t know what level your C++ is but writing your own basic 3D engine is also a great excuse to practice your OO principles. I’d strongly suggest you use STL to implement any collections you need rather than going with whatever simple home grown “linked list” or whatever the book might suggest.

I guess this might sound scary but you can actually have this up and running within 3 to 4 months (less if you can put more hours in), and like I say, it’ll equip you for working with and debugging other peoples engines in the future.


#23

hi

check out www.blitzmax.com for powerful but easy game oriented programing language :slight_smile: It has power of c/c++ and easy to understand and use…