diff options
author | Erik Kundiman <erik@megapahit.org> | 2023-09-10 10:17:43 +0800 |
---|---|---|
committer | Erik Kundiman <erik@megapahit.org> | 2023-09-10 10:17:43 +0800 |
commit | 040fe22d93fe67a73fc33493057f06f07371dbdd (patch) | |
tree | a392cc84a82826652a0d92a005bc5aaf48dabc86 /indra/newview/llmodelpreview.cpp | |
parent | e67022465d8189eb30135b6b7c0fe477b3b91819 (diff) |
Preprocess non portable OpenGL code
Diffstat (limited to 'indra/newview/llmodelpreview.cpp')
-rw-r--r-- | indra/newview/llmodelpreview.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/indra/newview/llmodelpreview.cpp b/indra/newview/llmodelpreview.cpp index cfc30e49a1..858a3c3827 100644 --- a/indra/newview/llmodelpreview.cpp +++ b/indra/newview/llmodelpreview.cpp @@ -3063,7 +3063,9 @@ BOOL LLModelPreview::render() LLGLDisable no_blend(GL_BLEND); LLGLEnable cull(GL_CULL_FACE); LLGLDepthTest depth(GL_FALSE); // SL-12781 disable z-buffer to render background color +#if GL_VERSION_1_1 LLGLDisable fog(GL_FOG); +#endif { gUIProgram.bind(); @@ -3267,7 +3269,9 @@ BOOL LLModelPreview::render() const U32 type_mask = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_TEXCOORD0; +#if GL_VERSION_1_1 LLGLEnable normalize(GL_NORMALIZE); +#endif if (!mBaseModel.empty() && mVertexBuffer[5].empty()) { @@ -3361,9 +3365,13 @@ BOOL LLModelPreview::render() if (edges) { glLineWidth(PREVIEW_EDGE_WIDTH); +#if GL_VERSION_1_1 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); +#endif buffer->drawRange(LLRender::TRIANGLES, 0, buffer->getNumVerts() - 1, buffer->getNumIndices(), 0); +#if GL_VERSION_1_1 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); +#endif glLineWidth(1.f); } buffer->flush(); @@ -3485,10 +3493,14 @@ BOOL LLModelPreview::render() gGL.diffuseColor4fv(PREVIEW_PSYH_EDGE_COL.mV); glLineWidth(PREVIEW_PSYH_EDGE_WIDTH); +#if GL_VERSION_1_1 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); +#endif buffer->drawRange(LLRender::TRIANGLES, 0, buffer->getNumVerts() - 1, buffer->getNumIndices(), 0); +#if GL_VERSION_1_1 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); +#endif glLineWidth(1.f); buffer->flush(); @@ -3502,7 +3514,9 @@ BOOL LLModelPreview::render() if (mHasDegenerate) { glLineWidth(PREVIEW_DEG_EDGE_WIDTH); +#if GL_VERSION_1_1 glPointSize(PREVIEW_DEG_POINT_SIZE); +#endif gPipeline.enableLightsFullbright(); //show degenerate triangles LLGLDepthTest depth(GL_TRUE, GL_TRUE, GL_ALWAYS); @@ -3571,7 +3585,9 @@ BOOL LLModelPreview::render() gGL.popMatrix(); } glLineWidth(1.f); +#if GL_VERSION_1_1 glPointSize(1.f); +#endif gPipeline.enableLightsPreview(); gGL.setSceneBlendType(LLRender::BT_ALPHA); } @@ -3712,9 +3728,13 @@ BOOL LLModelPreview::render() { gGL.diffuseColor4fv(PREVIEW_EDGE_COL.mV); glLineWidth(PREVIEW_EDGE_WIDTH); +#if GL_VERSION_1_1 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); +#endif buffer->draw(LLRender::TRIANGLES, buffer->getNumIndices(), 0); +#if GL_VERSION_1_1 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); +#endif glLineWidth(1.f); } } |