Category : game-development

I am learning SFML with c++, when I am compiling with mingw32-make it is giving error because I am using class file this is the error: main.o:main.cpp:(.text+0x16): undefined reference to `Game::Game()’ main.o:main.cpp:(.text+0x21): undefined reference to `Game::running() const’ main.o:main.cpp:(.text+0x30): undefined reference to `Game::pollEvent()’ main.o:main.cpp:(.text+0x3b): undefined reference to `Game::update()’ main.o:main.cpp:(.text+0x46): undefined reference to `Game::render()’ main.o:main.cpp:(.text+0x58): undefined reference ..

Read more

so i am trying to make a game using raylib, and i have 2 classes: Prop and Character. Character is derived from Prop. Prop.hpp #include <raylib.h> class Prop{ public: Prop(float x, float y, Texture2D t); void change_texture(Texture2D t){texture = t;} void change_texture(Image t){texture = LoadTextureFromImage(t);} void draw_self(){DrawTexturePro(texture, sourceRec, destRec, origin, 0.0f, WHITE);} protected: Rectangle sourceRec; ..

Read more

I’ve come upon these 2 posts: How to blur SDL_Surface without shaders? https://bacprogramming.wordpress.com/2018/01/10/box-blur-with-sdl2/ Both cover how to blur an SDL_Surface without the need of shaders like this: void blur() //This manipulates with SDL_Surface and gives it box blur effect { for (int y = 0; y < imageSurface->h; y++) { for (int x = 0; ..

Read more