Hi there,

This is my first time posting here so I would first like to apologize for any mistake I may make.

The reason I'm here is because I am designing an assignment in which I draw a .bmp to the screen and the image is supposed to float inside without leaving the window. I am not here asking for someone to do the assignment for me, just to help me out with some tips. I've had classes in c++ but for some reason win32 programming feels like c++ with an accent.

here is my code (by the way I am learning with Beginning game programming: second edition)

void Game_Run()
{
    //this is called once every frame
    //do not include your own loop here!


    static int x = 0, y = 0;
    RECT rect;
    GetClientRect(global_hwnd, &rect);

    if (rect.right > 0)
    {
        DrawBitmap(global_hdc, "asteroid.bmp", x, y);
		x++;
		if (x > rect.right)
			x = 0;
    }
	
}

the code was first set up to draw an infinite amount of pictures at random places and this is what I have so far, any tips will be appreciated.

Use Private Device Contexts.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.