Light theme is best theme, I'm not in the business of making my editor look like a 1990s hacker movie. I read a lot and the only people who prefer dark theme seem to be new programmers.
Hey, I was having some issues with the vector and the forloop using the emplace_back "C2661: no overloaded function takes 2 arguments" I'm not sure why it was not allowing me to use this on the vector but what i ended up doing is using the push_back function: -(below std::vector v BUT outside the forloop) SDL_Point temp; - (Inside for loop) temp.x = rand() % 640; - (right below that line) temp.y = rand() % 480; - (right below that line) v.push_back(temp); Not sure why i got that message but i got the same result using push_back
Tried using SDL2 in VSCodium on Arch but always got the error : "main.cpp:(.text+0x2d): undefined reference to `SDL_Init' ". Any idea what this could be? Thanks a lot.
Hello, when I run my programs, the window is not moveable, and I can not close the window using the window itself, I instead have to close the CMD window. Is there a fix to this?
I love your tutorials but the hardest part of following them is to get sdl2 installed, I'm getting bald with the ammout of errors and videos that work but not whey I try, I wish youn made a compehensive video about installing dependencis for c++ usage
are you on linux/mac/windows? it really depends on your operating system. It's a slow process but getting the build setup once is the most important part of development.
@@TheBuilder I'm on Windows compiling with g++, I think I finally got it but I don't understand nothing about how all this works, I get the header files, like they are where I get all my functionalities and all of that, but all the linker and lib stuff goes over my head
@@gasparliboreiro4572 I'm sorry but the last time I did any C++ development on windows, was about 14 years ago. Idk if I could be any help on this front
This is the 2nd tutorial of yours that I've ALMOST completed.This tutorial and the spinning cube in SDL2 works great up until I use the emplace_back function and then it breaks. Ive commented out the "v.emplace_back(rand() % 640, rand() % 480);" and it compiles fine. Any Idea? :\mingw\lib\gcc\mingw32\6.3.0\include\c++\ext ew_allocator.h:120:4: error: new initializer expression list treated as compound expression [-fpermissive] { ::new((void *)__p) _Up(std::forward(__args)...); } ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\ext ew_allocator.h:120:4: error: no matching function for call to 'SDL_Point::SDL_Point(int)' In file included from C:/SDL2-W-image/include/SDL2/SDL_video.h:33:0, from C:/SDL2-W-image/include/SDL2/SDL_events.h:33, from C:/SDL2-W-image/include/SDL2/SDL.h:41, from C:\Users\Admin\OneDrive\Documents\VSCodeProj\SDL2_Tutorials\.vscode\basic.cpp:1: C:/SDL2-W-image/include/SDL2/SDL_rect.h:48:16: note: candidate: SDL_Point::SDL_Point() typedef struct SDL_Point ^~~~~~~~~
@@TheBuilder My working solution is below...Any idea why SDL_Point has to be initialized before emplace_back can be used? Push_back didnt work either until I initialized in same manner. for (int i = 0; i < 100000; i++) { SDL_Point point = { rand() % 640, rand() % 480 }; v.emplace_back(point);
Subscribe for more
This is such a thorough tutorial. Helped me a lot!
thank you!
love the comprehensive explanation, gonna watch more
Light theme is a crime... Great tutorial though!
Light theme is best theme, I'm not in the business of making my editor look like a 1990s hacker movie. I read a lot and the only people who prefer dark theme seem to be new programmers.
Light theme attracts bugs
i am not new and i hate light mode it destroys my eyes
Hey, I was having some issues with the vector and the forloop using the emplace_back "C2661: no overloaded function takes 2 arguments"
I'm not sure why it was not allowing me to use this on the vector but what i ended up doing is using the push_back function:
-(below std::vector v BUT outside the forloop) SDL_Point temp;
- (Inside for loop) temp.x = rand() % 640;
- (right below that line) temp.y = rand() % 480;
- (right below that line) v.push_back(temp);
Not sure why i got that message but i got the same result using push_back
Had same problem thx!
Had this problem too, and your solution worked. Well explained, thank you.
wonderful tutorial. thank you!
Tried using SDL2 in VSCodium on Arch but always got the error : "main.cpp:(.text+0x2d): undefined reference to `SDL_Init' ". Any idea what this could be? Thanks a lot.
are you linking sdl?
Thanks a bunch, been having such a headache learning how to use this library, as graphics.h does not work on wayland. Saved me so much time.
Is it possible to set the renderer to be transparent?
Hello, when I run my programs, the window is not moveable, and I can not close the window using the window itself, I instead have to close the CMD window. Is there a fix to this?
You need to poll for the event that handles closing the window, I talk about it in the video on mouse and keyboard events
can someone tell me how to setup the sdl.h file?? (preference without ides...) when i downloaded it gave me an dll and a readme
Try moving 'SDL2.frameworks' into your frameworks folder. Assuming you're on Mac
@@famishedcrane2596 no, im in windows... (Windows 10 64 bits)
@@rodrigoqteixeira
I love your tutorials but the hardest part of following them is to get sdl2 installed, I'm getting bald with the ammout of errors and videos that work but not whey I try, I wish youn made a compehensive video about installing dependencis for c++ usage
are you on linux/mac/windows? it really depends on your operating system. It's a slow process but getting the build setup once is the most important part of development.
@@TheBuilder I'm on Windows compiling with g++, I think I finally got it but I don't understand nothing about how all this works, I get the header files, like they are where I get all my functionalities and all of that, but all the linker and lib stuff goes over my head
@@gasparliboreiro4572 I'm sorry but the last time I did any C++ development on windows, was about 14 years ago. Idk if I could be any help on this front
intersection.
yes
This is the 2nd tutorial of yours that I've ALMOST completed.This tutorial and the spinning cube in SDL2 works great up until I use the emplace_back function and then it breaks. Ive commented out the "v.emplace_back(rand() % 640, rand() % 480);" and it compiles fine.
Any Idea?
:\mingw\lib\gcc\mingw32\6.3.0\include\c++\ext
ew_allocator.h:120:4: error: new initializer expression list treated as compound expression [-fpermissive]
{ ::new((void *)__p) _Up(std::forward(__args)...); }
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\ext
ew_allocator.h:120:4: error: no matching function for call to 'SDL_Point::SDL_Point(int)'
In file included from C:/SDL2-W-image/include/SDL2/SDL_video.h:33:0,
from C:/SDL2-W-image/include/SDL2/SDL_events.h:33,
from C:/SDL2-W-image/include/SDL2/SDL.h:41,
from C:\Users\Admin\OneDrive\Documents\VSCodeProj\SDL2_Tutorials\.vscode\basic.cpp:1:
C:/SDL2-W-image/include/SDL2/SDL_rect.h:48:16: note: candidate: SDL_Point::SDL_Point()
typedef struct SDL_Point
^~~~~~~~~
try replacing emplace_back with push_back you just need to change it to something like this .push_back(SDL_Point(x,y))
hope that helped
@@TheBuilder I'm so sorry, can you be a little bit more explicit? I know your busy so no biggie if you can't. BTW, I really do love your vids
v.push_back(SDL_Point(rand() % 640, rand() % 480));
@@TheBuilder My working solution is below...Any idea why SDL_Point has to be initialized before emplace_back can be used? Push_back didnt work either until I initialized in same manner.
for (int i = 0; i < 100000; i++) {
SDL_Point point = { rand() % 640, rand() % 480 };
v.emplace_back(point);
@@mrdouble v.emplace_back(SDL_Point{ rand() % 640, rand() % 480 });
This works too