Added SetIcon function to RenderWindow

This commit is contained in:
Robert 2020-05-18 16:27:03 +02:00
parent cea768fce1
commit 85ab65737a
3 changed files with 67 additions and 0 deletions

View file

@ -4,9 +4,22 @@ int main(int argc, char** argv)
{
SDL_Init(SDL_INIT_VIDEO);
Uint32* icon_data = new Uint32[64 * 64];
for (int y = 0; y < 64; y++)
{
for (int x = 0; x < 64; x++)
{
icon_data[64 * y + x] = 0x004400FF;
icon_data[64 * y + x] |= (((Uint32)((y / 64.f) * 255) << 24));
icon_data[64 * y + x] |= (((Uint32)((x / 64.f) * 255) << 8));
}
}
MyWindow window(800, 800, "Test");
SDL_SetWindowTitle(window.GetWindow(), "New Title");
window.SetIcon(64, 64, icon_data);
SDL_Event event;
float t = 0.f;
while (window.IsOpen())