works
This commit is contained in:
parent
e79aa9488f
commit
cf5b938a2a
Binary file not shown.
@ -323,8 +323,9 @@ ds_render_next_frame()
|
|||||||
struct draw_instruction_t *instr;
|
struct draw_instruction_t *instr;
|
||||||
|
|
||||||
instr = dis_fetch_instruction();
|
instr = dis_fetch_instruction();
|
||||||
|
char valid = 1;
|
||||||
|
|
||||||
while (instr)
|
while (valid && instr)
|
||||||
{
|
{
|
||||||
switch (instr->type)
|
switch (instr->type)
|
||||||
{
|
{
|
||||||
@ -358,6 +359,7 @@ ds_render_next_frame()
|
|||||||
case DI_INVALID_INSTRUCTION:
|
case DI_INVALID_INSTRUCTION:
|
||||||
case DI_TERMINATE:
|
case DI_TERMINATE:
|
||||||
default:
|
default:
|
||||||
|
valid = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -378,7 +380,6 @@ ds_bind_texture(GLuint texture)
|
|||||||
{
|
{
|
||||||
if (ds.texture != texture)
|
if (ds.texture != texture)
|
||||||
{
|
{
|
||||||
printf("Swithing texture %u -> %u\n", ds.texture, texture);
|
|
||||||
ds.texture = texture;
|
ds.texture = texture;
|
||||||
glBindTexture(GL_TEXTURE_2D, texture);
|
glBindTexture(GL_TEXTURE_2D, texture);
|
||||||
}
|
}
|
||||||
@ -389,7 +390,6 @@ ds_use_shader(GLuint shader)
|
|||||||
{
|
{
|
||||||
if (ds.shader != shader)
|
if (ds.shader != shader)
|
||||||
{
|
{
|
||||||
printf("Switching shader %u -> %u\n", ds.shader, shader);
|
|
||||||
ds.shader = shader;
|
ds.shader = shader;
|
||||||
glUseProgram(shader);
|
glUseProgram(shader);
|
||||||
}
|
}
|
||||||
@ -583,7 +583,6 @@ draw_string_internal(vec2 xy, const char *string, xoverlay_font_handle_t font, v
|
|||||||
texture_glyph_t *glyph = texture_font_find_glyph(fnt, &string[i]);
|
texture_glyph_t *glyph = texture_font_find_glyph(fnt, &string[i]);
|
||||||
if (glyph == NULL)
|
if (glyph == NULL)
|
||||||
{
|
{
|
||||||
printf("glyph is NULL\n");
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (i > 0)
|
if (i > 0)
|
||||||
|
Binary file not shown.
@ -48,14 +48,12 @@ program_freetype_switch_font(xoverlay_font_handle_t font)
|
|||||||
texture_font_t *fnt = fontapi_get(font);
|
texture_font_t *fnt = fontapi_get(font);
|
||||||
if (fnt == NULL)
|
if (fnt == NULL)
|
||||||
return;
|
return;
|
||||||
printf("Switching font to %u\n", font);
|
|
||||||
if (fnt->atlas->id == 0)
|
if (fnt->atlas->id == 0)
|
||||||
{
|
{
|
||||||
glGenTextures(1, &fnt->atlas->id);
|
glGenTextures(1, &fnt->atlas->id);
|
||||||
}
|
}
|
||||||
ds_bind_texture(fnt->atlas->id);
|
ds_bind_texture(fnt->atlas->id);
|
||||||
if (fnt->atlas->dirty) {
|
if (fnt->atlas->dirty) {
|
||||||
printf("Refreshing atlas\n");
|
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||||
|
Binary file not shown.
@ -47,7 +47,6 @@ program_init_inplace(struct program_t *program, const char *vertex_format, const
|
|||||||
program->unload = unload;
|
program->unload = unload;
|
||||||
program->destroy = destroy;
|
program->destroy = destroy;
|
||||||
program->vertex = vertex_buffer_new(vertex_format);
|
program->vertex = vertex_buffer_new(vertex_format);
|
||||||
printf("vertex: %p\n", program->vertex);
|
|
||||||
|
|
||||||
program->shader = glCreateProgram();
|
program->shader = glCreateProgram();
|
||||||
GLint status;
|
GLint status;
|
||||||
|
BIN
src/programs.o
BIN
src/programs.o
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user