X-Git-Url: https://git.ucc.asn.au/?p=ipdf%2Fcode.git;a=blobdiff_plain;f=src%2Fscreen.cpp;h=5bca5544dc9042a04f051265b66ec56339397b81;hp=a49fa085c1081c92abf7c8bfc54557356d774e60;hb=433bde2ed090928b264203c9f422a5b220857120;hpb=c3509a1d169b5ac95623238dfc0badd54b5283ba diff --git a/src/screen.cpp b/src/screen.cpp index a49fa08..5bca554 100644 --- a/src/screen.cpp +++ b/src/screen.cpp @@ -8,47 +8,8 @@ #include "bufferbuilder.h" #include "shaderprogram.h" -#define BASICTEX_VERT \ - "#version 140\n"\ - "#extension GL_ARB_shading_language_420pack : require\n"\ - "#extension GL_ARB_explicit_attrib_location : require\n"\ - "\n"\ - "layout(std140, binding=0) uniform Viewport\n"\ - "{\n"\ - "\tfloat width;\n"\ - "\tfloat height;\n"\ - "};\n"\ - "\n"\ - "layout(location = 0) in vec2 position;\n"\ - "layout(location = 1) in vec2 tex_coord;\n"\ - "\n"\ - "out vec2 fp_tex_coord;\n"\ - "\n"\ - "void main()\n"\ - "{\n"\ - "\t// Transform to clip coordinates (-1,1, -1,1).\n"\ - "\tgl_Position.x = (position.x*2/width) - 1;\n"\ - "\tgl_Position.y = 1 - (position.y*2/height);\n"\ - "\tgl_Position.z = 0.0;\n"\ - "\tgl_Position.w = 1.0;\n"\ - "\tfp_tex_coord = tex_coord;\n"\ - "}\n" - -#define BASICTEX_FRAG \ - "#version 140\n"\ - "\n"\ - "in vec2 fp_tex_coord;\n"\ - "\n"\ - "out vec4 output_colour;\n"\ - "\n"\ - "uniform sampler2D tex;\n"\ - "uniform vec4 colour;\n"\ - "\n"\ - "void main()\n"\ - "{\n"\ - "\toutput_colour = colour;\n"\ - "\toutput_colour.a = texture(tex, fp_tex_coord).r;\n"\ - "}\n" +#define BASICTEX_VERT "shaders/basictex_vert.glsl" +#define BASICTEX_FRAG "shaders/basictex_frag.glsl" using namespace IPDF; using namespace std; @@ -425,6 +386,8 @@ void Screen::DebugFontFlush() glDisable(GL_BLEND); + m_debug_font_vertices.Invalidate(); + m_debug_font_indices.Invalidate(); m_debug_font_vertex_head = 0; m_debug_font_index_head = 0; }