[frames below may be incorrect and/or missing, no symbols loaded for user32.dll]
I am not sure what relevant code to show, as the program is pretty big. The following is the drawing part of the game:
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam){ int mouseX, mouseY; switch(message) {//the rendering part case WM_PAINT: gGame.tick(); ghdc = BeginPaint(hWnd, &gps); gGraphics.drawFrame(); EndPaint(hWnd, &gps); break; case WM_DESTROY: PostQuitMessage(0); break;//the onclick parsing case WM_LBUTTONDOWN: mouseX=(short)LOWORD(lParam); mouseY=(short)HIWORD(lParam); gSelection.onClick(mouseX, mouseY); InvalidateRect (hWnd, NULL, TRUE); UpdateWindow (hWnd); break; default: return DefWindowProc(hWnd, message, wParam, lParam); break; } return 0;}//this is the BBGraphics::draw() functionsvoid BBGraphics::drawFrame(){ for(unsigned int i=0;i<sprites.size();i++) if(sprites) sprites->draw();}void BBGraphics::draw(RECT &rct){ HBRUSH brush=CreateSolidBrush(color); FillRect(ghdc, &rct, brush);}//those are the BBSprite::draw() functions//both BBSprite and BBText are considered as spritesvoid BBSprite::draw(){ gGraphics.color=color; gGraphics.draw(rect);}//BBText::draw()void BBText::draw(){ SetTextColor(ghdc, color); TextOut(ghdc, rect.left, rect.top, text, text.length());}
Please note that the refreshing is done only after a mouse click, thus after 20 clicks the program crashes. I am really at loss for what this bug can be. Am I doing something wrong or is it the .dll that's bugging out? Any help would be appreciated.