To optimize OnPaint()...
Hi everyone!
Here''s my problem: i''d like to make a ticktacktoe game but when i wanna redraw the window i gotta rerdraw each pattern and also the grid. I think i should find another faster way to do this. i assume i should use a bitmap and fill it with the pixels'' colors, could someone explain to me how i should proceed please.
Tx 2 everyone.
God bless either programming and metal !!
Hey Kurt,
You planning on using some sort of hardware accelleration or are you going to use standard window stuff?
Either way your going to be storing a 3x3 array with the value of the grid. Such as X or O, or whatever. Since your doing it that way, all you have to do is parse through the list and draw to the screen the value at the correct location. Bitmaps will work and would probally be best if you want it to look good.
Make sure you render to the back buffer then flip it to the primary HDC and clear the back buffer... although, if your redrawing the entire screen anyway, you might be able to get away with not clearing the back buffer. If you just render to the HDC, your going to notice flicker.
Hope that was helpful!
Todd
You planning on using some sort of hardware accelleration or are you going to use standard window stuff?
Either way your going to be storing a 3x3 array with the value of the grid. Such as X or O, or whatever. Since your doing it that way, all you have to do is parse through the list and draw to the screen the value at the correct location. Bitmaps will work and would probally be best if you want it to look good.
Make sure you render to the back buffer then flip it to the primary HDC and clear the back buffer... although, if your redrawing the entire screen anyway, you might be able to get away with not clearing the back buffer. If you just render to the HDC, your going to notice flicker.
Hope that was helpful!
Todd
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement