I know that this is a kinda dumb question to ask here, but I have recently been getting stuck on creating a simple window in C++. I would like to customize things like it's name and stuff like that. The reason why I am asking that here is becasue I can't find any solution that works for me online. I have tried lots of things so far, but was never successful. I also do not want to use VS' presets because I don't really think they are the right way to go for me. Thanks for any effort of helping me with this problem!
Asked
Active
Viewed 272 times
-2
-
2_"I know that this is a kinda dumb question to ask here"_ - indeed it is, not because of the topic, or that this would be a super easy thing that everybody should know about, no - your question simpyl lacks any useful information about the real problem. You got stuck _somewhere_ after having tried _some things_. Noone can possibly answer such a vague question. Please take our [tour] and see [ask] to learn what makes a question a good question. – Lukas-T May 15 '21 at 16:13
-
You're going to need a deep dive into your operating system's windowing API, or find and learn a library that does it for you. Either way it's way outside the scope of a StackOverflow answer, even if you were able to focus the question. – Mark Ransom May 15 '21 at 16:29
-
P.S. the reason VS provides those presets is because even just a "Hello World" app is a lot of work with a huge amount of boiler-plate. They just want to get you off the ground as quickly as possible. – Mark Ransom May 15 '21 at 16:33
-
I suggest you have a look at [this](https://www.youtube.com/watch?v=b0zxIfJJLAY) video on how to make the *World's Smallest Windows App in x86 ASM*. Code is [here](https://pastebin.com/Pmvr4r1S). So why not? If you insist on C++, then check out this [tutorial](https://openglcornellbox.wordpress.com/tutorials/cornell-box-part-2/) – not2qubit May 15 '21 at 17:10
-
1Since windows are not part o C++, you probably should specify your system (e.g. "Windows", "Linux", etc.) both in the question and in the tags. – JaMiT May 15 '21 at 19:00
1 Answers
1
SDL provides a really nice and simple cross-platform API to create a basic window and renderer (http://www.libsdl.org/).

Richard Bamford
- 1,835
- 3
- 15
- 19
-
Not much of example code there... Lot's of tutorials, no pictures and nothing complete. Otherwise it seem great. – not2qubit May 15 '21 at 16:22
-
1Yeah true, i stumbled upon their documentation which has good examples here https://wiki.libsdl.org/APIByCategory https://wiki.libsdl.org/SDL_CreateWindowAndRenderer – Richard Bamford May 15 '21 at 18:12
-
Yeah, I've now spent 2 hours trying to find/get a MVP for this question. Unfortunately, even if the *main* code is short, the problem for beginners is finding and setting up the correct collection of compilers, libraries and related dependencies. TBH, that is the real PITA for beginners who just wanna make a [Hello World](https://gist.github.com/fschr/92958222e35a823e738bb181fe045274) window. What do we need to download from [there](http://www.libsdl.org/download-2.0.php)? – not2qubit May 15 '21 at 18:47
-
1@not2qubit Get your IDE setup with https://github.com/microsoft/vcpkg and create a CMake based project. – Richard Bamford May 15 '21 at 20:34
-
1My point here, I think is not to use a bloated IDE to *magically* setup everything, but being able to run stuff from a minimal environment directly from a terminal shell. I have now provided a complete solution, in my extensive answer to *[How to render text in SDL2?](https://stackoverflow.com/a/67553575/1147688)*. – not2qubit May 16 '21 at 13:42