Skip to content

Commit 11f7c04

Browse files
committed
OpenGL MacOS
1 parent 4ae3305 commit 11f7c04

File tree

3 files changed

+8
-16
lines changed

3 files changed

+8
-16
lines changed
0 Bytes
Binary file not shown.

IGNMap/Source/MainComponent.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,7 @@ void MainComponent::NewWindow()
799799
void MainComponent::AboutIGNMap()
800800
{
801801
juce::String version = "0.0.5";
802-
juce::String info = "04/06/2024";
802+
juce::String info = "06/06/2024";
803803
juce::String message = "IGNMap 3 Version : " + version + "\n" + info + "\n";
804804
message += "JUCE Version : " + juce::String(JUCE_MAJOR_VERSION) + "."
805805
+ juce::String(JUCE_MINOR_VERSION) + "." + juce::String(JUCE_BUILDNUMBER) + "\n";

IGNMap/Source/OGL3DViewer.cpp

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ OGLWidget::OGLWidget()
3535
{
3636
setSize(500, 500);
3737
setWantsKeyboardFocus(true);
38-
openGLContext.setOpenGLVersionRequired(juce::OpenGLContext::openGL4_1);
38+
openGLContext.setOpenGLVersionRequired(juce::OpenGLContext::openGL3_2);
3939
// openGL3_2 est recommande par JUCE mais probleme sur MacOS avec glLineWidth
4040
openGLContext.setContinuousRepainting(true);
4141
vertexShader = nullptr;
@@ -338,22 +338,17 @@ void OGLWidget::render()
338338
}
339339
}
340340

341-
//glEnable(GL_PRIMITIVE_RESTART);
342-
//glPrimitiveRestartIndex(0xFFFFFFFF);
341+
// Dessin des polygones et des lignes
342+
glEnable(GL_PRIMITIVE_RESTART);
343+
glPrimitiveRestartIndex(0xFFFFFFFF);
344+
glLineWidth(m_VectorWidth); // Ne marche pas sur MacOS
343345
// Dessin des polygones
344346
if ((m_nNbPolyVertex > 0) && (!m_bNeedUpdate) && (m_bViewVector)) {
345347
openGLContext.extensions.glBindVertexArray(m_PolyVertexArrayID);
346348
openGLContext.extensions.glBindBuffer(GL_ARRAY_BUFFER, m_PolyBufferID);
347349
openGLContext.extensions.glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_PolyElementID);
348350
m_Attributes->enable();
349-
glEnable(GL_PRIMITIVE_RESTART_FIXED_INDEX);
350-
//glEnable(GL_PRIMITIVE_RESTART);
351-
//glPrimitiveRestartIndex(0xFFFFFFFF);
352-
glDisable(GL_LINE_SMOOTH);
353-
glLineWidth(m_VectorWidth);
354351
glDrawElements(GL_LINE_LOOP, m_nNbPolyVertex + m_nNbPoly, GL_UNSIGNED_INT, 0);
355-
glDisable(GL_PRIMITIVE_RESTART_FIXED_INDEX);
356-
//glDisable(GL_PRIMITIVE_RESTART);
357352
m_Attributes->disable();
358353
}
359354

@@ -363,21 +358,18 @@ void OGLWidget::render()
363358
openGLContext.extensions.glBindBuffer(GL_ARRAY_BUFFER, m_LineBufferID);
364359
openGLContext.extensions.glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_LineElementID);
365360
m_Attributes->enable();
366-
glEnable(GL_PRIMITIVE_RESTART_FIXED_INDEX);
367-
glLineWidth(m_VectorWidth);
368361
glDrawElements(GL_LINE_STRIP, m_nNbLineVertex + m_nNbLine, GL_UNSIGNED_INT, 0);
369-
glDisable(GL_PRIMITIVE_RESTART_FIXED_INDEX);
370362
m_Attributes->disable();
371363
}
372-
//glDisable(GL_PRIMITIVE_RESTART);
364+
glDisable(GL_PRIMITIVE_RESTART);
373365

374366
if (m_bNeedUpdate)
375367
UpdateBase();
376368

377369
// Dessin du repere orthonorme
378370
openGLContext.extensions.glBindBuffer(GL_ARRAY_BUFFER, m_RepereID);
379371
m_Attributes->enable();
380-
glLineWidth(3.0);
372+
glLineWidth(3.0); // Ne marche pas sur MacOS
381373
glDrawArrays(GL_LINES, 0, 6);
382374
m_Attributes->disable();
383375

0 commit comments

Comments
 (0)