change how redrawing is done. fixes memory leak and other fun shit.

calling GetDC() over and over again isn't a good idea.
This commit is contained in:
StapleButter 2017-02-06 00:07:22 +01:00
parent 3cf38e3e9d
commit 86cdf28323
2 changed files with 11 additions and 5 deletions

View File

@ -141,11 +141,16 @@ LRESULT CALLBACK derpo(HWND window, UINT msg, WPARAM wparam, LPARAM lparam)
}
return 0;
/*case WM_PAINT:
case WM_PAINT:
{
PAINTSTRUCT partisocialiste;
HDC dc = BeginPaint(window, &partisocialiste);
SetDIBitsToDevice(dc, 0, 0, 256, 384, 0, 0, 0, 384, GPU::Framebuffer, (BITMAPINFO*)&bmp, DIB_RGB_COLORS);
EndPaint(window, &partisocialiste);
}
return 0;*/
return 0;
}
return DefWindowProc(window, msg, wparam, lparam);
@ -230,8 +235,9 @@ int main()
NDS::RunFrame();
HDC dc = GetDC(melon);
SetDIBitsToDevice(dc, 0, 0, 256, 384, 0, 0, 0, 384, GPU::Framebuffer, (BITMAPINFO*)&bmp, DIB_RGB_COLORS);
//HDC dc = GetDC(melon);
//SetDIBitsToDevice(dc, 0, 0, 256, 384, 0, 0, 0, 384, GPU::Framebuffer, (BITMAPINFO*)&bmp, DIB_RGB_COLORS);
InvalidateRect(melon, NULL, false);
UpdateWindow(melon);
nframes++;

View File

@ -10,7 +10,7 @@
1481161027 c:\documents\sources\melonds\types.h
1486312246 source:c:\documents\sources\melonds\nds.cpp
1486333824 source:c:\documents\sources\melonds\nds.cpp
<stdio.h>
<string.h>
"NDS.h"