mirror of
https://github.com/nishiowo/nishbox
synced 2025-04-21 12:14:39 +00:00
move 2d toggle to texture draw
This commit is contained in:
parent
b734e42c5c
commit
732db3182b
@ -133,6 +133,7 @@ void nb_draw_driver_reshape(nb_draw_t* draw) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void nb_draw_driver_draw_texture(nb_draw_t* draw, float x, float y, float w, float h, nb_draw_driver_texture_t* texture, float r, float g, float b, float a) {
|
void nb_draw_driver_draw_texture(nb_draw_t* draw, float x, float y, float w, float h, nb_draw_driver_texture_t* texture, float r, float g, float b, float a) {
|
||||||
|
nb_graphic_begin_2d(draw);
|
||||||
glDisable(GL_LIGHTING);
|
glDisable(GL_LIGHTING);
|
||||||
glDisable(GL_DEPTH_TEST);
|
glDisable(GL_DEPTH_TEST);
|
||||||
glEnable(GL_TEXTURE_2D);
|
glEnable(GL_TEXTURE_2D);
|
||||||
@ -154,6 +155,7 @@ void nb_draw_driver_draw_texture(nb_draw_t* draw, float x, float y, float w, flo
|
|||||||
glDisable(GL_TEXTURE_2D);
|
glDisable(GL_TEXTURE_2D);
|
||||||
glEnable(GL_DEPTH_TEST);
|
glEnable(GL_DEPTH_TEST);
|
||||||
glEnable(GL_LIGHTING);
|
glEnable(GL_LIGHTING);
|
||||||
|
nb_graphic_end_2d(draw);
|
||||||
}
|
}
|
||||||
|
|
||||||
void nb_draw_driver_destroy(nb_draw_t* draw) {
|
void nb_draw_driver_destroy(nb_draw_t* draw) {
|
||||||
|
@ -37,9 +37,7 @@ void nb_graphic_clear(nb_draw_t* draw) { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_
|
|||||||
|
|
||||||
void nb_graphic_text(nb_draw_t* draw, float x, float y, float size, const char* text, float r, float g, float b, float a) {
|
void nb_graphic_text(nb_draw_t* draw, float x, float y, float size, const char* text, float r, float g, float b, float a) {
|
||||||
int i;
|
int i;
|
||||||
nb_graphic_begin_2d(draw);
|
|
||||||
for(i = 0; text[i] != 0; i++) {
|
for(i = 0; text[i] != 0; i++) {
|
||||||
nb_draw_texture(draw, x + i * (size / 2), y, size / 2, size, draw->font[text[i]], r, g, b, a);
|
nb_draw_texture(draw, x + i * (size / 2), y, size / 2, size, draw->font[text[i]], r, g, b, a);
|
||||||
}
|
}
|
||||||
nb_graphic_end_2d(draw);
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user