Click here to Skip to main content
15,885,216 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: Thought of the Day Pin
OriginalGriff12-Apr-21 5:43
mveOriginalGriff12-Apr-21 5:43 
GeneralRe: Thought of the Day Pin
Greg Utas12-Apr-21 5:56
professionalGreg Utas12-Apr-21 5:56 
GeneralRe: Thought of the Day Pin
W Balboos, GHB12-Apr-21 5:44
W Balboos, GHB12-Apr-21 5:44 
GeneralRe: Thought of the Day Pin
Daniel Pfeffer12-Apr-21 7:01
professionalDaniel Pfeffer12-Apr-21 7:01 
GeneralRe: Thought of the Day Pin
grralph112-Apr-21 22:23
grralph112-Apr-21 22:23 
JokeRe: Thought of the Day Pin
Daniel Pfeffer12-Apr-21 22:38
professionalDaniel Pfeffer12-Apr-21 22:38 
GeneralRe: Thought of the Day Pin
grralph112-Apr-21 23:03
grralph112-Apr-21 23:03 
GeneralThis bug makes me want to cry Pin
honey the codewitch12-Apr-21 3:20
mvahoney the codewitch12-Apr-21 3:20 
Update: WHO'S A SUPERSTAR? I FIXED IT. I needed a pair of parentheses. Unsure | :~

I spent weeks - weeks! working on a device independent pixel in C++

I finally built it, and it seems to work, but they're tricky because they store the pixel in the form of its final memory representation in a frame buffer, so if you defined a pixel as 24-bit color, there's a new pixel every 3 bytes, and if you defined a pixel as 18-bit color (6 bits each for R, G, and B - shockingly common) then there's a new pixel every 2.25 bytes!

So it gets ... tricky. There's bit shifting, masking and whatnot.

I'm not testing on an actual display device yet, so i have code that converts small bitmaps to monochrome and then renders them as "acii art"

My blting works, my filling works, and my clearing works, when the pixels are either byte-aligned (like 24 bit pixels) or 1 bit (monochrome), but the 18-bit one is weird, and clearing isn't working.

I think it's with my bit setting code, i thought, but also no, because it's clearing in the wrong place?

Each pixel is #, or black is just empty space. I have a hatch pattern i bltted and them i'm clearing a box inside of it. The clearing is what is failing.

Basically, this is what i get when it works:
# # # # # # # #
 # # # # # # # 
# # # # # # # #
 #           # 
# #         # #
 #           # 
# #         # #
 #           # 
# #         # #
 #           # 
# #         # #
 #           # 
# # # # # # # #
 # # # # # # # 
# # # # # # # #


This works for rgb888 (24-bit), mono1 (1-bit) and rgb565 (16-bit). rgb666 (18-bit) however, is being truly evil:

# # #          
       # # # # 
# # # # # # # #
 # # # # # # # 
# # # # # # # #
 # # # # # # # 
# # # # # # # #
 # # # # # # # 
# # # # # # # #
 # # # # # # # 
# # # # # # # #
 # # # # # # # 
# # # # # # # #
 # # # # # # # 
# # # # # # # #


What gets me is the bits that it *is* clearing. Look at the empty run above. How the elephant did it get that? It's not even starting in the right place. WTF | :WTF:

So now I know where a spare day of my life is going.

Never make rgb666 pixels. They are truly satan's children.
Real programmers use butterflies


modified 12-Apr-21 10:09am.

GeneralRe: This bug makes me want to cry Pin
Greg Utas12-Apr-21 3:33
professionalGreg Utas12-Apr-21 3:33 
GeneralRe: This bug makes me want to cry Pin
honey the codewitch12-Apr-21 3:52
mvahoney the codewitch12-Apr-21 3:52 
GeneralRe: This bug makes me want to cry Pin
Member 1299508712-Apr-21 4:35
Member 1299508712-Apr-21 4:35 
GeneralRe: This bug makes me want to cry Pin
k505412-Apr-21 4:45
mvek505412-Apr-21 4:45 
GeneralRe: This bug makes me want to cry Pin
honey the codewitch12-Apr-21 4:53
mvahoney the codewitch12-Apr-21 4:53 
GeneralRe: This bug makes me want to cry Pin
Member 1299508712-Apr-21 5:13
Member 1299508712-Apr-21 5:13 
GeneralRe: This bug makes me want to cry Pin
honey the codewitch12-Apr-21 5:59
mvahoney the codewitch12-Apr-21 5:59 
GeneralRe: This bug makes me want to cry Pin
Member 1299508712-Apr-21 20:36
Member 1299508712-Apr-21 20:36 
GeneralRe: This bug makes me want to cry Pin
Richard MacCutchan12-Apr-21 5:11
mveRichard MacCutchan12-Apr-21 5:11 
GeneralRe: This bug makes me want to cry Pin
Greg Utas12-Apr-21 5:27
professionalGreg Utas12-Apr-21 5:27 
GeneralRe: This bug makes me want to cry Pin
honey the codewitch12-Apr-21 6:37
mvahoney the codewitch12-Apr-21 6:37 
GeneralRe: This bug makes me want to cry Pin
Greg Utas12-Apr-21 7:01
professionalGreg Utas12-Apr-21 7:01 
GeneralRe: This bug makes me want to cry Pin
honey the codewitch12-Apr-21 7:09
mvahoney the codewitch12-Apr-21 7:09 
GeneralRe: This bug makes me want to cry Pin
Greg Utas12-Apr-21 7:20
professionalGreg Utas12-Apr-21 7:20 
GeneralRe: This bug makes me want to cry Pin
Daniel Pfeffer12-Apr-21 20:26
professionalDaniel Pfeffer12-Apr-21 20:26 
GeneralRe: This bug makes me want to cry Pin
Greg Utas13-Apr-21 1:00
professionalGreg Utas13-Apr-21 1:00 
GeneralRe: This bug makes me want to cry Pin
Daniel Pfeffer12-Apr-21 20:33
professionalDaniel Pfeffer12-Apr-21 20:33 

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.