I can't seem to get void main() to work instead of int main(). I want the dos box to dissapear. Whenever i compile with void main(), it says that main must return int. Thanks for any help
~~ The Robomaniac
void Main not working
-
- Posts: 602
- Joined: Sat Aug 23, 2003 2:03 am
- Location: Pottstown, PA
- Contact:
-
- Posts: 602
- Joined: Sat Aug 23, 2003 2:03 am
- Location: Pottstown, PA
- Contact:
-
- Posts: 602
- Joined: Sat Aug 23, 2003 2:03 am
- Location: Pottstown, PA
- Contact:
I copied and pasted the winmain from the tech demo and it shows the console as stated above. the only difference is that i am not using classes, and i'm using OpenGL. I included windows.h also. one more thing, how can you delete text, say for a gui that has a text that says "Loading..." that dissapears when loading is done. Thanks
~~ The Robomanaic
~~ The Robomanaic
Hm, it works here. Maybe I should try with DevC++ and OpenGL, maybe there is a problem. BTW: In windows, there is a function for making the console window invisble. Don't know the name, but I think you can find it yourself.
Deleting text works with ->remove(), making it invisible works with ->setVisible(false);
Deleting text works with ->remove(), making it invisible works with ->setVisible(false);
-
- Posts: 271
- Joined: Sat Aug 23, 2003 5:52 pm
- Location: Hurricane Central, Florida
You cant have a main funtion that returns nothing (void) it has to return something. But you can get rid of that console easily by making a int WINAPI winMain(......) function and an LRESULT CALLBACK function to handle window messages. If you've never seen this done before check out the tutorials on http://nehe.gamedev.net/ or just search gamedev.net or google for game programming tutorials. Most will be in Visual C++ 6 but thats what you should be using anyway.
-
- Posts: 2
- Joined: Fri Aug 22, 2003 7:45 am
- Location: France