Any tips on a basic windows gui application

Almost have my basics for my 2d game. It is basically very simple:
There is a (homemade) rgba bitmap which should be put to screen with the windows gdi function bitblt().

Getting lost in the options for creating a basic windows application and looking for a crate (winapi? windows? egui? ...) any tips are welcome.
(Chat GPT gave me incompilable code, when trying the winapi crate)

In fact I only need a window to paint on and a message loop to handle mouse and key input and a magic way to change the mouse cursor.

(sound and music i will implement myself using bass.dll)

Sounds like you are looking for the winit crate.

This crate is what you need, I think

winit worked out of the box from the example in the documentation. looks promising.
winsafe i did not look at.

1 Like

now the next step is to put my RGBA array on-screen without another dependency...

I know it's literally another dependency, but softbuffer is probably what you're looking for. It integrates with winit to let you paint an arbitrary bitmap on a window.

The benefit of this library over the alternatives is that everything is CPU-rendered, so you don't pull in a shader compiler or any other complicated dependencies.

Otherwise, there's nothing stopping you from reading the softbuffer source code to get inspiration for your own implementation.

Ok thanks. was just browsing through that one!
It is of course nice if I do not import StretchDiBits and only support Windows.

I read some post about softbuffer, but it probably is much too slow. WIth my windows bitblt routine i got between 300 and 1100 FPS. softbuffer seems to be slow. and before spending hours getting it working.... Are there people who have experience with this?