- Joined
- Apr 19, 2015
- Messages
- 1,023
- Trophies
- 1
- Location
- Stuck in the PowerPC
- Website
- heyquark.com
- XP
- 3,912
- Country
Was about to say the same thing. Most of dimok's GX2-enabled homebrew actually uses hardware rendering. Even HBL does that!Actually loadiine has 3D-stuff in it
(Yeah I now what you mean)
As an example, software rendering in HBL might look something like this:
Code:
//Assuming everything's already been magic'd down to pixel data
void draw(Element** elementList, int elementListLength) {
unsigned char* pix_buf = malloc(SCREEN_BUFFER_SIZE);
for (int i = 0; i < elementListLength; i++) {
Element* e = elementList[i];
//Draw to *buffer in memory*
//You obviously wouldn't use memcpy for this, because you're not insane, right?
//This is more for illustration of what's going on conceptually. You'll have to imagine that it wraps pixel lines.
memcpy(pix_buf[e->offset], e->pixelData, e->pixelDataLength);
}
GX2PutADamnImageOnScreen(pix_buf, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT); //helper function
}
However, when super simplified, HBL's rendering stuff looks more like this:
Code:
void draw(Element** elementList, int elementListLength) {
for (int i = 0; i < elementListLength; i++) {
Element* e = elementList[i];
GX2PutADamnImageOnScreen(e->pixelData, e->x, e->y, e->width, e->height);
}
}
As you can see, each individual element gets sent to the graphics card, well, individually. It's then up to the graphics card to put together some pixel data to send out to the screen. Being a graphics card, it's quite good at this.
This was an insanely simple example. In the real world, your elements aren't all pixel data, and you don't want to stick with 2D. This doesn't even take much advantage of the hardware, and is definitely optimized for a bunch of prerendered images (did someone say HBL?) Loadiine's cover flow is properly 3D, however, with models and everything.