Sign in to follow this  
Mitchell314

In a windows form application, where does the 'To do' code go?

Recommended Posts

Mitchell314    185
Hello, I'm new. I've looked at the NeHe demos and articles, and also articles for applications, and I can't figure out where my code goes. I'm used to the "start at the top" languages (QBASIC), but now I've tried C++, I can't figure where the working code goes. Does it go into the win main? Sorry, I know I'm being vague, but I can't seem to figure anything out for this. I have been using Dev-C++ IDE.

Share this post


Link to post
Share on other sites
cignox1    735
Have you already taken some experience with c++ console applicastions, before going on with WinForm? If not, then leave WinForm aside for a short time and make some simple console applications. Then make a very basic Form appearing on the screen (not many lines of code, really). Learn wich is the flow of the program, how to handle events sent from the OS, wich are the events you can handle and so on. It is a huge world and the only way to approach it is step by step.

Share this post


Link to post
Share on other sites
Mitchell314    185
Thanks. I can make console apps fairly easily. But I want to make graphics in C++, and the only way I know is to use OpenGL through window forms. But I have trouble finding where the actual drawing is done. Or anything else for that manner. I know how to use OpenGL's commands, but as to how event handling works, I'm lost.

Share this post


Link to post
Share on other sites
Crypter    748
Quote:

I've looked at the NeHe demos and articles, and also articles for applications, and I can't figure out where my code goes. I'm used to the "start at the top" languages (QBASIC), but now I've tried C++, I can't figure where the working code goes. Does it go into the win main?

In C and C++, you need to define the functions and classes for your working code. Windows applications begin in WinMain(), however this does not mean that all of your working code goes in it.

Quote:

I can make console apps fairly easily. But I want to make graphics in C++, and the only way I know is to use OpenGL through window forms.

Usually you would not use windows forms for use with OpenGL (Rather, I have never seen it.) The NeHe code uses the Win32 API and WGL to setup and use OpenGL for rendering.

Quote:

But I have trouble finding where the actual drawing is done. Or anything else for that manner. I know how to use OpenGL's commands, but as to how event handling works, I'm lost.

The actual rendering is done by OpenGL's commands (like glVertex3f).

How much experience do you have with windows programming? If not too much, I personally recommend starting here before NeHe.

Share this post


Link to post
Share on other sites
Mitchell314    185
The only experience I have with windows is having an IDE make the app. That's about it. I've used OpenGL in FreeBASIC, so I know how it works (a little bit), I just don't know where the drawing commands would in the source code.

Share this post


Link to post
Share on other sites
Crypter    748
Quote:

How much experience do you have with windows programming? If not too much, I personally recommend starting here before NeHe.

^I personally recommend this then, as it would be hard using OpenGL in windows without using the Win32 API. (Or, rather, without knowledge of windows programming.)

...Unless you decide to use GLUT, another API or library.

Share this post


Link to post
Share on other sites
cignox1    735
If the only reason for you to learn forms is for crating a window to render with OGL, then you may find it easier to use SDL. It will handle window creation, input management and will help you with network and threads. It is free and cross platform.
If you decide to give it a look I warn you that you may find troubles settings it up properly. Use the search tool here on gamedev to find help in previous topics.
Once it compiles, using it is straightforward.

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