Click here to Skip to main content
15,892,005 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: I've been stuck for two days on nothing Pin
Gary R. Wheeler23-Jun-21 14:09
Gary R. Wheeler23-Jun-21 14:09 
GeneralRe: I've been stuck for two days on nothing Pin
honey the codewitch23-Jun-21 14:23
mvahoney the codewitch23-Jun-21 14:23 
GeneralRe: I've been stuck for two days on nothing Pin
Marc Clifton23-Jun-21 15:54
mvaMarc Clifton23-Jun-21 15:54 
GeneralRe: I've been stuck for two days on nothing Pin
honey the codewitch23-Jun-21 16:22
mvahoney the codewitch23-Jun-21 16:22 
GeneralRe: I've been stuck for two days on nothing Pin
Greg Utas23-Jun-21 15:56
professionalGreg Utas23-Jun-21 15:56 
GeneralRe: I've been stuck for two days on nothing Pin
honey the codewitch23-Jun-21 16:15
mvahoney the codewitch23-Jun-21 16:15 
GeneralRe: I've been stuck for two days on nothing Pin
NeverJustHere23-Jun-21 18:08
NeverJustHere23-Jun-21 18:08 
GeneralRe: I've been stuck for two days on nothing Pin
honey the codewitch23-Jun-21 18:36
mvahoney the codewitch23-Jun-21 18:36 
That's not possible because there is no common base to use.

Different draw targets are entirely distinct types.

Furthermore, each draw target is typed by the type of its pixel.

So for example, if you have a bitmap<rgb_pixel<16>> and bitmap<rgb_pixel<24>>, the former indicating a bitmap with 16-bit color RGB pixels and the latter indicating 24-bit RGB, each bitmap is a different type. And it must be because the drawing code for a 16-bit pixel is different than that of a 24-bit pixel because the layout in memory of what it's drawing is different.

A bitmap<> is an example of a draw target, but each screen you can draw to is a draw target as well. A draw target is anything you can draw on.

Ergo, each screen mode is also a draw target, and if it has a different type of pixel than the next, it must be a different type.

There can be no common base since 90% of the drawing methods will take a pixel and that has a particular type. So even if i made a base type, that type would have to be a template.

This is generic programming and it's powerful, but it's not polymorphic in the traditional way we think about polymorphism.

It sounds like you might be a C++ dev but I don't want to assume. If you're not a C++ dev I'm not sure if there's an analogy for this style of coding in any other language.

OO principles only loosely apply here though. GP is a different animal.
Real programmers use butterflies

GeneralRe: I've been stuck for two days on nothing Pin
NeverJustHere23-Jun-21 23:53
NeverJustHere23-Jun-21 23:53 
GeneralRe: I've been stuck for two days on nothing Pin
honey the codewitch24-Jun-21 1:20
mvahoney the codewitch24-Jun-21 1:20 
GeneralRe: I've been stuck for two days on nothing Pin
ElectronProgrammer25-Jun-21 12:33
ElectronProgrammer25-Jun-21 12:33 
GeneralRe: I've been stuck for two days on nothing Pin
honey the codewitch25-Jun-21 15:21
mvahoney the codewitch25-Jun-21 15:21 
GeneralRe: I've been stuck for two days on nothing Pin
Greg Utas24-Jun-21 0:32
professionalGreg Utas24-Jun-21 0:32 
GeneralRe: I've been stuck for two days on nothing Pin
honey the codewitch24-Jun-21 1:24
mvahoney the codewitch24-Jun-21 1:24 
GeneralRe: I've been stuck for two days on nothing Pin
Greg Utas24-Jun-21 1:41
professionalGreg Utas24-Jun-21 1:41 
GeneralRe: I've been stuck for two days on nothing Pin
honey the codewitch24-Jun-21 1:51
mvahoney the codewitch24-Jun-21 1:51 
GeneralRe: I've been stuck for two days on nothing Pin
Member 1419238225-Jun-21 3:42
Member 1419238225-Jun-21 3:42 
GeneralRe: I've been stuck for two days on nothing Pin
honey the codewitch25-Jun-21 4:36
mvahoney the codewitch25-Jun-21 4:36 
QuestionRe: I've been stuck for two days on nothing Pin
CPallini24-Jun-21 2:21
mveCPallini24-Jun-21 2:21 
AnswerRe: I've been stuck for two days on nothing Pin
honey the codewitch24-Jun-21 6:09
mvahoney the codewitch24-Jun-21 6:09 
GeneralRe: I've been stuck for two days on nothing Pin
obeobe24-Jun-21 22:58
obeobe24-Jun-21 22:58 
GeneralRe: I've been stuck for two days on nothing Pin
AnotherKen25-Jun-21 17:54
professionalAnotherKen25-Jun-21 17:54 
GeneralRe: I've been stuck for two days on nothing Pin
honey the codewitch25-Jun-21 18:22
mvahoney the codewitch25-Jun-21 18:22 
GeneralRe: I've been stuck for two days on nothing Pin
AnotherKen26-Jun-21 7:55
professionalAnotherKen26-Jun-21 7:55 
GeneralRe: I've been stuck for two days on nothing Pin
honey the codewitch26-Jun-21 9:12
mvahoney the codewitch26-Jun-21 9:12 

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.