Solved GDI Flicker

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat
Status
Not open for further replies.

Clarityworld

Jr.Coder
Full Member
Nobleman
Feb 20, 2015
71
523
2
Hello :rolleyes:

I'm drawing something to a Game with GDI, and my problem is it kinda Flicker alot. I basicly use the draw fuction stated on msdn.

C++:
  Pen blackPen(Color(255, 0, 0, 0), 3);

   
   int x = 0;
   int y = 0;
   int width = 200;
   int height = 200;


   graphics.DrawRectangle(&blackPen, x, y, width, height);

C++:
 graphics.DrawRectangle(&blackPen, x, y, width, height);
^Is in a Loop, even when i set the max fps to 30 ingame it still flickers slightly which is really annoying for my overlay.
Anyone can help me out ? I believe msdn just provided a easy example which can be improved ?
I read about Buffering but I found no example for this.
 
Last edited:

Dohax

Newbie
Full Member
Apr 21, 2015
15
128
0
Which game is it for?
You could make it redraw every 0.2 seconds rather than as fast as your PC allows. I don't think there's really much need for it to redraw every 0.0001 seconds.
 

Obsta

Jr.Hacker
Meme Tier VIP
Jan 27, 2014
394
4,338
17
Read about buffering, implement it, then implement a second buffer. It will fix your issue. Use the key phrase 'Double buffering' in your Google searches.

Which game is it for?
You could make it redraw every 0.2 seconds rather than as fast as your PC allows. I don't think there's really much need for it to redraw every 0.0001 seconds.
Changing the redraw rate won't affect the flickering, it will always be present without a buffer.
 
Last edited:

Dohax

Newbie
Full Member
Apr 21, 2015
15
128
0
Read about buffering, implement it, then implement a second buffer. It will fix your issue. Use the key phrase 'Double buffering' in your Google searches.



Changing the redraw rate won't affect the flickering, it will always be present without a buffer.
So what you're saying is, it removes the previously drawn elements before it knows what to draw next? (So there comes a delay between, causing the flickering?)
 

Obsta

Jr.Hacker
Meme Tier VIP
Jan 27, 2014
394
4,338
17
So what you're saying is, it removes the previously drawn elements before it knows what to draw next? (So there comes a delay between, causing the flickering?)
No, It doesn't clear the window until its ready to copy the newest screen. WM_ERASEBKGND should only be returning after you have drawn to both buffers, they should never be empty if you have correctly setup buffering.
 
Status
Not open for further replies.
Attention! Before you post:

Read the How to Ask Questions Guide
99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

  • Fill out the form correctly
  • Tell us the game name & coding language
  • Post everything we need to know to help you
  • Ask specific questions, be descriptive
  • Post errors, line numbers & screenshots
  • Post code snippets using code tags
  • If it's a large project, zip it up and attach it

If you do not comply, your post may be deleted.  We want to help, please make a good post and we will do our best to help you.

Similar threads

Community Mods