mirror of
https://github.com/kevinbentley/Descent3.git
synced 2026-04-04 20:00:04 -04:00
[gl] extracted some common GPU rendering code
This commit is contained in:
@@ -2482,38 +2482,6 @@ ddgr_color rend_GetPixel(int x, int y) {
|
||||
return color[0];
|
||||
}
|
||||
|
||||
void rend_FillCircle(ddgr_color col, int x, int y, int rad) {}
|
||||
|
||||
void rend_DrawCircle(int x, int y, int rad) {}
|
||||
|
||||
// Sets up a font character to draw. We draw our fonts as pieces of textures
|
||||
void rend_DrawFontCharacter(int bm_handle, int x1, int y1, int x2, int y2, float u, float v, float w, float h) {
|
||||
g3Point *ptr_pnts[4];
|
||||
g3Point pnts[4];
|
||||
for (int i = 0; i < 4; i++) {
|
||||
pnts[i].p3_z = 1; // Make REALLY close!
|
||||
pnts[i].p3_flags = PF_PROJECTED;
|
||||
ptr_pnts[i] = &pnts[i];
|
||||
}
|
||||
pnts[0].p3_sx = x1;
|
||||
pnts[0].p3_sy = y1;
|
||||
pnts[0].p3_u = u;
|
||||
pnts[0].p3_v = v;
|
||||
pnts[1].p3_sx = x2;
|
||||
pnts[1].p3_sy = y1;
|
||||
pnts[1].p3_u = u + w;
|
||||
pnts[1].p3_v = v;
|
||||
pnts[2].p3_sx = x2;
|
||||
pnts[2].p3_sy = y2;
|
||||
pnts[2].p3_u = u + w;
|
||||
pnts[2].p3_v = v + h;
|
||||
pnts[3].p3_sx = x1;
|
||||
pnts[3].p3_sy = y2;
|
||||
pnts[3].p3_u = u;
|
||||
pnts[3].p3_v = v + h;
|
||||
rend_DrawPolygon2D(bm_handle, ptr_pnts, 4);
|
||||
}
|
||||
|
||||
// Draws a line
|
||||
void rend_DrawLine(int x1, int y1, int x2, int y2) {
|
||||
sbyte atype;
|
||||
@@ -2535,6 +2503,7 @@ void rend_DrawLine(int x1, int y1, int x2, int y2) {
|
||||
rend_SetLighting(LS_NONE);
|
||||
rend_SetTextureType(TT_FLAT);
|
||||
|
||||
// TODO: Generalize
|
||||
dglBegin(GL_LINES);
|
||||
dglColor4ub(r, g, b, 255);
|
||||
dglVertex2i(x1 + gpu_state.clip_x1, y1 + gpu_state.clip_y1);
|
||||
|
||||
Reference in New Issue
Block a user