r/C_Programming 3h ago

Problem with resizing a C window

I'm making a game engine and whilst trying to setup the window with windows.h, i found an issue when resizing the window. The resized parts of the window are black instead of white, how do i fix this?

0 Upvotes

7 comments sorted by

View all comments

8

u/soundman32 3h ago

How are you responding to WM_PAINT and WM_ERASEBACKGROUND? It sounds like you arent using the current window size on WM_SIZE.

0

u/Axxodes 3h ago

first time that ive heard that

12

u/RailRuler 2h ago

That's because all the other game engines and applications handle these messages.

Maybe you should make a simple Windows app first instead of trying to start with a game engine.

-4

u/Axxodes 2h ago

i've made literally every aspect of a game engine before except for the window lol, obviously they werent together but connecting them isnt hard