Просмотр исходного кода

Line width support in new renderer

Ivan Safrin 10 лет назад
Родитель
Сommit
332e429c03

+ 1 - 0
include/polycode/core/PolyOpenGLGraphicsInterface.h

@@ -80,6 +80,7 @@ namespace Polycode {
         void enableDepthTest(bool val);
         void enableDepthWrite(bool val);
         void enableBackfaceCulling(bool val);
+        void setLineSize(Number lineSize);
         
 	protected:
 		

+ 1 - 0
include/polycode/core/PolyRenderer.h

@@ -62,6 +62,7 @@ namespace Polycode {
             virtual void enableDepthWrite(bool val) = 0;
             virtual void setBlendingMode(unsigned int blendingMode) = 0;
             virtual void enableBackfaceCulling(bool val) = 0;
+            virtual void setLineSize(Number lineSize) = 0;
         
             virtual void beginDrawCall() = 0;
             virtual void endDrawCall() = 0;

BIN
lib/osx/libPolycore.a


+ 4 - 0
src/core/PolyOpenGLGraphicsInterface.cpp

@@ -537,6 +537,10 @@ void OpenGLGraphicsInterface::enableDepthWrite(bool val) {
     }
 }
 
+void OpenGLGraphicsInterface::setLineSize(Number lineSize) {
+    glLineWidth(lineSize);
+}
+
 void OpenGLGraphicsInterface::clearBuffers(const Color &clearColor, bool colorBuffer, bool depthBuffer, bool stencilBuffer) {
     GLbitfield clearMask = 0;
     

+ 1 - 0
src/core/PolyRenderer.cpp

@@ -89,6 +89,7 @@ void RenderThread::processDrawBuffer(GPUDrawBuffer *buffer) {
         interface->enableDepthTest(buffer->drawCalls[i].options.depthTest);
         interface->enableDepthWrite(buffer->drawCalls[i].options.depthWrite);
         interface->enableBackfaceCulling(buffer->drawCalls[i].options.backfaceCull);
+        interface->setLineSize(buffer->drawCalls[i].options.linePointSize);
         
         modelMatrixParam->setMatrix4(buffer->drawCalls[i].modelMatrix);