Advertisement

02.03 - The Basic Windows Application

Started by April 09, 2001 12:08 AM
26 comments, last by Teej 21 years, 6 months ago
Uhh...ok, but this doesnt tell me how to spawn the window. This tutorial assumes I would already know that I guess. So how do I just spawn up a plain old boring basic Windows window on my screen that does nothing but stay open untill I alt-ctrl-delete it. I have been looking for code that does this FOREVER and all I can find is too advanced. Thanks.
2032:
You can find what are you looking for in topics 4.* ( and basecode1.zip) . But I adivce you to read Teej''s tutorial in order ( that is what I did) and you''ll get in no time to understand a basic game template and from there you will be able to explore yourself.
Advertisement
Sooo... I''ve been programming for years in VB and web stuff (JScript, VBScript, PERL, etc.) and took up C/C++ a couple months ago, too.

Question for Teej: Why NOT use C++ classes to do some of this stuff? It seems to me that all the nice stuff that C++ gives you (type safety, inline functions, CLASSES!!!, inheritance, etc.) would be a huge help in game development. Why use straight C? What''s the advantage over C++?

Ok, maybe this question is a little big... Feel free to reply via email or point me to some other place for my answer if you want!

Thanks!
I know what these are but I''m having a hard time following their meaning.Does that mean I should just turn back now??I mean from these other posts the others seem to be way ahead of me.

The road to hell is paved in good intentions
The road to hell is paved in good intentions

ok, you guys are probly thinking i''m realy stupid. Posting on each page with a question that never gets answered, but i need some help. I have no clue. This page is talking about the message loop, i get all that, what it does an all. But i don''t quite understand how to use this and all them codes that is displayed.

I read through the whole thing, i turned my compiler on, and i typed in the main message loop. Then i kept reading to the
"What is typically done for a game is a slight modification of the message loop" part and got lost. How am i supposed to configure these into the compiler codes and stuff that is already typed in.

I probably make no sence, i meen i''m only 13, but this is realy interesting. Can someone (if you understand me) pleeez help!

Only the eyes of a true player will see what realy beholds the game. Only the eyes of a true player may see the pixels and nothing else. Only the eyes of the true player can see the game, feel the game, be the game. I am a true player. Are you?
Only the eyes of a true player will see what realy beholds the game. Only the eyes of a true player may see the pixels and nothing else. Only the eyes of the true player can see the game, feel the game, be the game. I am a true player. Are you?
Ok i''m bak i have yet another question. *sigh*. I moved my compiler to the desktop and now its working. Thank God.

Now, i type in a symple calculator code:
#include <iostream>
#include <stdlib.h>

int main(int argc, char argv);
{
{
int a,b,c;
printf("enter the first value");
scanf("%d",&a);
printf("enter the second value");
scanf("%d",&b);
c=a+b;
printf("%d+%d=%d\n",a,b,c);
return 0;
}
}
system("PAUSE");
return 0;
and it pops up with an error message:
5 C:\Dev-C++\main.cpp parse error before `{''
8 C:\Dev-C++\main.cpp
ANSI C++ forbids declaration `printf'' with no type
and 28 others. This is getting on my nerves. Ahh! Help me pleez. I don''t even know what Parse means. If any one knows anything i''m talking about, please, please, please, help me!!! I hope someone actually looks at this page and helps.



Only the eyes of a true player will see what realy beholds the game. Only the eyes of a true player may see the pixels and nothing else. Only the eyes of the true player can see the game, feel the game, be the game. I am a true player. Are you?
Only the eyes of a true player will see what realy beholds the game. Only the eyes of a true player may see the pixels and nothing else. Only the eyes of the true player can see the game, feel the game, be the game. I am a true player. Are you?
Advertisement
Ok, I''ll try to help you. If I got your last post right, you just wanted to create a simple calculator. (c = a + b)

I don''t know if the following code is C or C++, but right now, it''s the way I would do it.

First of all, for such a small programm you don''t need the arguments given in the main function. This way, the program would start with:

#include <iostream.h>

int main(void)
{
//declare the variables
int a;
int b;
int c;

//some text and the input
cout << "Enter the first number: ";
cin >> a;
cout << "\nEnter the second number: ";
cin >> b;

//the calculation and the output with the sum
c = a + b;
cout << "The sum is " << c << "\n";

return 0;
}

I think that''s all, for the beginning. Your programm, I think, is just too complicated, for the thing you want to do. You don''t have the right structure. But maybe it''s right, and I just posted a stupid code.

------------------------------
"Everything that can go wrong, goes wrong!"
------------------------------"Everything that can go wrong, goes wrong!"
Instead of a complete rewrite, the reason the compiler barfed for Y&I is that his main() function had a semicolon after it.

This topic is closed to new replies.

Advertisement