RGBA textures
This commit is contained in:
@@ -40,26 +40,6 @@ display_t DISPLAY = { 0 };
|
||||
}
|
||||
#endif
|
||||
|
||||
meshvertex_t vertices[3] = {
|
||||
{
|
||||
.color = COLOR_RED_4B,
|
||||
.uv = { 0.5f, 1.0f },
|
||||
.pos = { 0.0f, 15.0f, 0.0f }
|
||||
},
|
||||
|
||||
{
|
||||
.color = COLOR_GREEN_4B,
|
||||
.uv = { 0.0f, 0.0f },
|
||||
.pos = { -15.0f, -15.0f, 0.0f }
|
||||
},
|
||||
|
||||
{
|
||||
.color = COLOR_BLUE_4B,
|
||||
.uv = { 1.0f, 0.0f },
|
||||
.pos = { 15.0f, -15.0f, 0.0f }
|
||||
}
|
||||
};
|
||||
|
||||
errorret_t displayInit(void) {
|
||||
#if DISPLAY_SDL2
|
||||
uint32_t flags = SDL_INIT_VIDEO;
|
||||
@@ -213,6 +193,36 @@ errorret_t displayUpdate(void) {
|
||||
);
|
||||
errorChain(sceneRender());
|
||||
|
||||
color_t colors[4 * 4] = {
|
||||
COLOR_RED_4B, COLOR_GREEN_4B, COLOR_BLUE_4B, COLOR_YELLOW_4B,
|
||||
COLOR_CYAN_4B, COLOR_MAGENTA_4B, COLOR_WHITE_4B, COLOR_BLACK_4B,
|
||||
COLOR_ORANGE_4B, COLOR_PURPLE_4B, COLOR_GRAY_4B, COLOR_BROWN_4B,
|
||||
COLOR_PINK_4B, COLOR_LIME_4B, COLOR_NAVY_4B, COLOR_TEAL_4B
|
||||
};
|
||||
texturedata_t data = {
|
||||
.rgba = { .colors = colors }
|
||||
};
|
||||
|
||||
camera_t camera;
|
||||
cameraInit(&camera);
|
||||
|
||||
texture_t texture;
|
||||
textureInit(&texture, 4, 4, TEXTURE_FORMAT_RGBA, data);
|
||||
|
||||
cameraPushMatrix(&camera);
|
||||
spriteBatchClear();
|
||||
spriteBatchPush(
|
||||
&texture,
|
||||
-1, -1,
|
||||
1, 1,
|
||||
COLOR_WHITE_4B,
|
||||
0, 0,
|
||||
1, 1
|
||||
);
|
||||
spriteBatchFlush();
|
||||
cameraPopMatrix();
|
||||
textureDispose(&texture);
|
||||
|
||||
// Render UI
|
||||
// uiRender();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user