Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 911 vs 912 for /trunk/Source Code/Platform/Video/OpenGL/GLWrapper.cpp

Diff revisions: vs.
  @@ -213,6 +213,16 @@
213 213 { "vec3" , "_bitangentWV"}
214 214 };
215 215
216 + static const stringImpl crossTypeGLSLHLSL = "#define float2 vec2\n"
217 + "#define float3 vec3\n"
218 + "#define float4 vec4\n"
219 + "#define int2 ivec2\n"
220 + "#define int3 ivec3\n"
221 + "#define int4 ivec4\n"
222 + "#define float2x2 mat2\n"
223 + "#define float3x3 mat3\n"
224 + "#define float4x4 mat4";
225 +
216 226 auto getPassData = [](ShaderType type) -> stringImpl {
217 227 stringImpl baseString = " _out.%s = _in[index].%s;";
218 228 if (type == ShaderType::TESSELATION_CTRL) {
  @@ -252,6 +262,9 @@
252 262 appendToShaderHeader(ShaderType::VERTEX, "invariant gl_Position;", lineOffsets);
253 263
254 264 appendToShaderHeader(ShaderType::COUNT,
265 + crossTypeGLSLHLSL,
266 + lineOffsets);
267 + appendToShaderHeader(ShaderType::COUNT,
255 268 Util::StringFormat("#define GPU_VENDOR_AMD %d", to_base(GPUVendor::AMD)),
256 269 lineOffsets);
257 270 appendToShaderHeader(ShaderType::COUNT,
  @@ -754,10 +767,15 @@
754 767 return _fontCache.second;
755 768 }
756 769
757 - /// Text rendering is handled exclusively by Mikko Mononen's FontStash library
758 - /// (https://github.com/memononen/fontstash)
770 + /// Text rendering is handled exclusively by Mikko Mononen's FontStash library (https://github.com/memononen/fontstash)
759 771 /// with his OpenGL frontend adapted for core context profiles
760 772 void GL_API::drawText(const vectorImpl<GUITextBatchEntry>& batch) {
773 + static BlendingProperties textBlend;
774 + textBlend._blendSrc = BlendProperty::SRC_ALPHA;
775 + textBlend._blendDest = BlendProperty::INV_SRC_ALPHA;
776 +
777 + GL_API::setBlending(0, true, textBlend, Util::ToByteColour(DefaultColours::DIVIDE_BLUE()));
778 +
761 779 if (Config::ENABLE_GPU_VALIDATION) {
762 780 pushDebugMessage("OpenGL render text start!", 2);
763 781 }
  @@ -814,10 +832,8 @@
814 832 // Set the proper render states
815 833 setStateBlock(cmd.pipeline().stateHash());
816 834 // We need a valid shader as no fixed function pipeline is available
817 - DIVIDE_ASSERT(cmd.pipeline().shaderProgram() != nullptr,
818 - "GFXDevice error: Draw shader state is not valid for the current draw operation!");
819 - // Try to bind the shader program. If it failed to load, or isn't loaded
820 - // yet, cancel the draw request for this frame
835 + DIVIDE_ASSERT(cmd.pipeline().shaderProgram() != nullptr, "GFXDevice error: Draw shader state is not valid for the current draw operation!");
836 + // Try to bind the shader program. If it failed to load, or isn't loaded yet, cancel the draw request for this frame
821 837 return cmd.pipeline().shaderProgram()->bind();
822 838 }
823 839