I’m trying to draw simple opengl line or triangle (no matter) and when I run this on mac os x, it works. But not on iOSl. I see just blue screen without triangle or any line.
Here is my code below.
Can someone tell what is wrong with this code? I use example from JUCE > OpenGL Application
Second issue that the color array seems not to be working, because lines has a white color.
void MainComponent::render()
{
GLfloat vertices
{
-1.0f, -1.0f, 0.0f,
0.0f, 1.0f, 0.0f,
1.0f, -1.0f, 0.0f
};
uint8_t colors
{
25, 80, 0, 255,
25, 80, 190, 255,
25, 180, 0, 255
};
openGLContext.extensions.glEnableVertexAttribArray(0);
openGLContext.extensions.glEnableVertexAttribArray(2);
openGLContext.extensions.glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, vertices);
openGLContext.extensions.glVertexAttribPointer(2, 4, GL_UNSIGNED_BYTE, GL_TRUE, 0, colors);
OpenGLHelpers::clear(Colours::blue);
glDrawArrays(GL_LINE_STRIP, 0, 3);
}