Click here to Skip to main content
15,887,083 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Wordle 611 Pin
Sander Rossel19-Feb-23 21:56
professionalSander Rossel19-Feb-23 21:56 
GeneralRe: Wordle 611 Pin
ChandraRam19-Feb-23 22:16
ChandraRam19-Feb-23 22:16 
GeneralRe: Wordle 611 Pin
Cp-Coder20-Feb-23 0:57
Cp-Coder20-Feb-23 0:57 
GeneralRe: Wordle 611 -close - very close Pin
pkfox20-Feb-23 1:18
professionalpkfox20-Feb-23 1:18 
GeneralRe: Wordle 611 (2/6) Pin
musefan20-Feb-23 4:20
musefan20-Feb-23 4:20 
GeneralRe: Wordle 611 3/6 Pin
jmaida20-Feb-23 10:51
jmaida20-Feb-23 10:51 
Generalworldle 394 1/6 Pin
jmaida19-Feb-23 13:04
jmaida19-Feb-23 13:04 
RantDirty rectangle woes Pin
honey the codewitch18-Feb-23 21:27
mvahoney the codewitch18-Feb-23 21:27 
I'm building a control library in C++ that sits on top of my IoT graphics library and provides interactive user interface elements, kind of like winforms, but less elaborate.

I hate dirty rectangle finding routines. I've never been able to quite wrap my head around them, and to the degree that I can, what I come up with is almost certainly a naïve approach and not optimally performant.


1. Go through a list of controls. Of the controls that are visible and need to be redrawn. Find overlapping controls. If they overlap then you want to draw them both at once so you don't send to the display twice. Making an overlap list is way more difficult than I want it to be. But basically we create buckets of controls.

2. For each bucket of overlapping controls:
2a. try to create a bitmap that's large enough to hold all the overlapping controls in the bucket
2b. if you can't then split the bucket into several rectangles, and draw the controls more than once if need be. (more difficult than it sounds)
2c. call the render method on each control in the bucket, and then call the screen render callback to send that bitmap to the appropriate position on the display

I can articulate the above, but implementing it is another matter. With the full STL it would be much easier, but I don't necessarily have access to it, so I have my own simple vector library.

Absolutely frustrating. I'll solve it - I already know how, more or less. It's just a matter of stewing on it, creating the code, testing and optimizing it. In some ways I'm close - at least in terms of design - but beyond that may as well be the moon.

Edit: The above isn't quite right algorithmically, and I've since adjusted things.
To err is human. Fortune favors the monsters.


modified 19-Feb-23 4:08am.

GeneralRe: Dirty rectangle woes Pin
gggustafson19-Feb-23 5:31
mvagggustafson19-Feb-23 5:31 
GeneralRe: Dirty rectangle woes Pin
honey the codewitch19-Feb-23 6:19
mvahoney the codewitch19-Feb-23 6:19 
GeneralRe: Dirty rectangle woes Pin
gggustafson19-Feb-23 7:41
mvagggustafson19-Feb-23 7:41 
GeneralRe: Dirty rectangle woes Pin
honey the codewitch19-Feb-23 10:21
mvahoney the codewitch19-Feb-23 10:21 
GeneralRe: Dirty rectangle woes Pin
Daniel Pfeffer19-Feb-23 6:31
professionalDaniel Pfeffer19-Feb-23 6:31 
GeneralRe: Dirty rectangle woes Pin
honey the codewitch19-Feb-23 11:50
mvahoney the codewitch19-Feb-23 11:50 
GeneralRe: Dirty rectangle woes Pin
Daniel Pfeffer19-Feb-23 18:50
professionalDaniel Pfeffer19-Feb-23 18:50 
GeneralRe: Dirty rectangle woes Pin
honey the codewitch19-Feb-23 22:19
mvahoney the codewitch19-Feb-23 22:19 
GeneralRe: Dirty rectangle woes Pin
Daniel Pfeffer20-Feb-23 3:05
professionalDaniel Pfeffer20-Feb-23 3:05 
GeneralRe: Dirty rectangle woes Pin
honey the codewitch20-Feb-23 3:58
mvahoney the codewitch20-Feb-23 3:58 
QuestionRe: Dirty rectangle woes Pin
megaadam19-Feb-23 22:22
professionalmegaadam19-Feb-23 22:22 
AnswerRe: Dirty rectangle woes Pin
honey the codewitch19-Feb-23 22:34
mvahoney the codewitch19-Feb-23 22:34 
GeneralRe: Dirty rectangle woes Pin
megaadam19-Feb-23 22:59
professionalmegaadam19-Feb-23 22:59 
GeneralRe: Dirty rectangle woes Pin
honey the codewitch19-Feb-23 23:19
mvahoney the codewitch19-Feb-23 23:19 
GeneralRe: Dirty rectangle woes Pin
BillWoodruff20-Feb-23 2:23
professionalBillWoodruff20-Feb-23 2:23 
GeneralRe: Dirty rectangle woes Pin
honey the codewitch20-Feb-23 4:03
mvahoney the codewitch20-Feb-23 4:03 
GeneralWordle 610 Pin
StarNamer@work18-Feb-23 13:50
professionalStarNamer@work18-Feb-23 13:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.