Creating a window in windows using only int main()

Started by
23 comments, last by phresnel 14 years, 12 months ago
I prefer something like this:
//main.cpp - compiled on all platformsint main(){  //whatever}//main.win32.cpp - compiled only when targetting windowsextern int main();int WINAPI WinMain(..){  main();}
Advertisement
On this forum, helping people takes priority over answering the questions that have actually been asked. As the question-asker, you must accept the possibility that you are not asking the right questions, if you want to get anywhere. You are not required to pay for any of this, so you are not in control of what you get back.

Quote:Original post by DarkBalls
Will you please stop saying "Write Games not engines". I'm here to ask for help on how to open a window using only int main() and not using any libraries at all and not about the engines!


If you are not taking advantage of existing code to do things, and you are trying to do those things, then you have to write the code to do those things. If those things aren't directly required for "writing the game", then they are a part of "writing the engine".

We understand what you're asking about. The point is that you are wasting your time by attempting to do it. You can't open the window any better than the library can. Opening the window is platform-specific, so you will have to write the code for each platform and recompile for each version, arranging for main() to call to whatever. Excpet that on Windows, you'll probably have to use WinMain() instead of main() anyway because that's just how Windows works.

The point of using a library is that the library already understands how to handle these things.

You haven't yet given a reasonable reason for why you "want to dump SDL now". We're giving you one for not dumping it.

Quote:So, if you are telling me to write games not engine, just keep it in yourself. That's what you want. So be it. Just shut the fuck up! But I'll never follow you.


Nice attitude to present towards the people you're depending on for help, yeah?

Quote:If you want to be just a game developer who code games or actually don't know how the graphics engines works. Ok, that's what you want to be. Go for it!


Being able to get the window set up on each platform has nothing to do with understanding how to do graphics. Understanding how to translate the source into machine code has nothing to do with writing the game, either. That's why we use a compiler. It's the same thing. If you want to try to scrape everything out with a hex editor, go ahead. But it'd be your own fault if you worked at that for months and still didn't have a working "Hello world".

Quote:We are creating a 3D engine because we love it, we love graphics, we love algorithms, we love trees, we love shaders, and we love math. So only "Mediocre engines"?


That mentality leads to writing mediocre engines. At any rate, it leads to writing worse engines than you're capable of.

Quote:Why the hell are you comparing the physics engine on just windowing?


You're the only one making such a comparison. He didn't even say anything about physics.

Quote:Are you in drugs? You're insane really. We are focus only in 3D graphics not everything else.


Then focus on what you're focussed on. Hint: making nice 3D graphics has nothing to do with getting the window set up to display them in.

Quote:If we are going to create a game in the future, we might use Havok or PhysX.

And honestly, I think you didn't understand the article about "Write games not engine". I think the author should put "FOR NOW" in the end if you really understand his conclusions.


I'm not convinced that you've understood the article. If you took the time to read the article and understand it, you'd have calmed down a bit.

Quote:I'm really pissed off on those people who really think they are so smart. Ok, you're so smart now because you're not like me who is so stupid(for you because of what you believe) that creates a 3d engine, and you are using our engine. lmfao.


I can barely even make any sense out of that. This is not a real-time chat; edit your post before you submit it.

But I doubt rip-off - or anyone here - is actually using your engine. Who are you, anyway?
Quote:Original post by DarkBalls
stupid me.

Dunno, maybe. But I prefer to call you overheated and unexperienced. Otoh, those are stupid who curse the counsel of the elders.


Quote:And honestly, I think you didn't understand the article about "Write games not engine". I think the author should put "FOR NOW" in the end if you really understand his conclusions.

No, reading and reflecting two words is not understanding the conclusion.

Also, if your intention is really to write an engine, the statement "Write games not engines" can easily be transformed to "Write an engine, not device drivers", or "Write a device driver, not an operating system".


Quote:If you want to be just a game developer who code games or actually don't know how the graphics engines works. Ok, that's what you want to be. Go for it!

Somehow it makes me nervous that I am currently no engine-developer, not even a game-developer. Heck, I am just a frickin' applications developer boohoohoooo [sad]

Jokes aside: DarkBalls, as you are a hardcore programmer, have you ever considered participating in X11 device driver development? You nearly get to the raw metal, should be the right thing for you. Don't be just a userspace graphics programmer. Free yourself.


Quote:We are creating a 3D engine because we love it, we love graphics, we love algorithms, we love trees, we love shaders, and we love math. So only "Mediocre engines"?

If you love all those, why bother writing low level code or assembly to just show a window?


Quote:... and you are using our engine.

No, I am not.
Hey, I started a flamewar....

In my defense, the reason for linking SFML was to suggest looking at its source to see how an IMHO well-written API accomplishes that.
Quote:Original post by Antheus
Hey, I started a flamewar....


Not really, it was the big bang's fault ;)

edit: That is, if we take it to an extreme.

This topic is closed to new replies.

Advertisement