A little help, please...for the new guy

Started by
15 comments, last by obi-wan shinobi 21 years ago
Why are you telling the lad to forget about DirectX? Let him decide for himself!

It is not right to steer a person away from something.

My advice learn c++ first! Then look on google for DirectX tutorials and OpenGL tutorials.
TechleadEnilno, the Ultima 2 projectwww.dr-code.org/enilno
Advertisement
Okay. I''ve added opengl32.lib under VC++, and I still get one unresolved external to something like "_main". I''ll try those other two libraries to see how they work, and to learn a little more C++ besides functions and classes. To learn either OGL or DX, would I need to spend lots of time on it or just whenever I have time?
you need to rename your main() func to int WINAPI WinMain().

and as for which to use, OGL or DX, the choice is yours. at the moment, i daresay that DX has more features than OGL, but with the release of OGL 2 that could easily change. i prefer DX, but i dont want to steer you away (or towards) either one. why dont u try both and see which u like the best...?

[edited by - charsoft on April 4, 2003 7:48:56 PM]
quote:Original post by obi-wan shinobi
Okay. I''ve added opengl32.lib under VC++, and I still get one unresolved external to something like "_main". I''ll try those other two libraries to see how they work, and to learn a little more C++ besides functions and classes. To learn either OGL or DX, would I need to spend lots of time on it or just whenever I have time?


_main is the entry point of your program...
i.e. main()

If you don''t know what main is for, I suggest you learn more C++ before attempting anything else.
quote:Original post by obi-wan shinobi
Okay. I''ve added opengl32.lib under VC++, and I still get one unresolved external to something like "_main". I''ll try those other two libraries to see how they work, and to learn a little more C++ besides functions and classes. To learn either OGL or DX, would I need to spend lots of time on it or just whenever I have time?


how do you mean to start your program if you don''t have a main? Is that an opengl/glut console application, or a win32 application? Your program should have either a main() or a WinMain().

You should start learning C/C++ thouroughly. You need a book, with step by step C/C++ tutorials, then write string-based little text games. You don''t really need to go into great details about C++ to start programming. Standard C will do just fine.

struct/pointers/type/functions/variable/memory/multi-dimensional arrays are basic concepts you must master before starting programming for real. If you have no idea about graphics programming, learn about vectors, matrices, transform pipeline, rasterisation, cliping, frustums, triangles, vertices, normals, local coordinate systems, bitmaps, texturing, lighting, z-buffers, frame buffers..... You must at least understand how those things work. They are all rather inter-dependant, so a good book is recommended. I''m not sure if "OpenGL Games Programming" give an introduction to the underlying principles in OpenGL and graphics, but it''s considered to be one of the best book for newbies.

After that, if you start with glut/opengl, it''s very easy. DirectX (or Win32 OpenGL) is a lot more complicated at first for someone who never programmed before. It doesn''t mean ''forget it'', but in about a day, with glut you can write a program and actually know what you are doing. After you are very confident with your programming, you can start messing around with DX8, which involves programming the Windows32 interface (Win32).

http://nehe.gamedev.net/ has the most well know OpenGL tutorials on the web. If you get stuck, you can get advice quickly.

Everything is better with Metal.

The main part of the program has "int WINAPI WinMain". The following is the whole declaration (it doesn't really look like this, but I can't get it to show up like usual):

int WINAPI WinMain( HINSTANCE hInstance,
// Instance

HINSTANCE hPrevInstance,
// Previous Instance

LPSTR lpCmdLine,
// Command Line Parameters

int nCmdShow)
// Window Show State

As I may have said before, I haven't altered any of NeHe's code; I've just been trying to understand how it goes and getting it to actually work. I know what main() does in a small C++ program, such as the "Hello World" sample program, but I don't know what WinMain or WINAPI does, since I've only taken a year's worth of C++ classes and I didn't catch on to it much during the second half.

[edited by - obi-wan shinobi on April 5, 2003 4:10:37 AM]

[edited by - obi-wan shinobi on April 5, 2003 4:12:04 AM]
Good news! I''ve got the programs to work now...what I had to do was change WINAPI WinMain() to just the usual main(). I also had to add opengl32.lib, glu32.lib, and glaux.lib - I might be able to go a little further with NeHe''s tutorials now.

Thanks for the help, everyone!

This topic is closed to new replies.

Advertisement