diff options
author | StapleButter <thetotalworm@gmail.com> | 2017-02-06 00:07:22 +0100 |
---|---|---|
committer | StapleButter <thetotalworm@gmail.com> | 2017-02-06 00:07:22 +0100 |
commit | 86cdf283231fd4485c4731f6cbbe08e5cb4ae731 (patch) | |
tree | 212c4677a5d3bddbcef2195e256479b534f02165 | |
parent | 3cf38e3e9ddbd72dc37a302e245592159cecb57d (diff) |
change how redrawing is done. fixes memory leak and other fun shit.
calling GetDC() over and over again isn't a good idea.
-rw-r--r-- | main.cpp | 14 | ||||
-rw-r--r-- | melonDS.depend | 2 |
2 files changed, 11 insertions, 5 deletions
@@ -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++; diff --git a/melonDS.depend b/melonDS.depend index e9b21c4..c6090ec 100644 --- a/melonDS.depend +++ b/melonDS.depend @@ -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" |