@@ -36,7 +36,7 @@ int MiniGL::m_width = 0;
36
36
int MiniGL::m_height = 0 ;
37
37
int MiniGL::m_windowWidth = 0 ;
38
38
int MiniGL::m_windowHeight = 0 ;
39
- Real MiniGL::m_devicePixelRatio = 1 .0f ;
39
+ Real MiniGL::m_devicePixelRatio = 1.0 ;
40
40
Quaternionr MiniGL::m_rotation;
41
41
Real MiniGL::m_zoom = 1.0 ;
42
42
Vector3r MiniGL::m_translation;
@@ -709,24 +709,24 @@ void MiniGL::viewport ()
709
709
710
710
void MiniGL::initLights ()
711
711
{
712
- m_ambientIntensity << 0.2 , 0.2 , 0.2 ;
712
+ m_ambientIntensity << 0 .2f , 0 .2f , 0 .2f ;
713
713
714
714
m_numLights = 3 ;
715
715
m_diffuseIntensity.resize (m_numLights * 3 );
716
716
m_specularIntensity.resize (m_numLights * 3 );
717
717
m_lightPosition.resize (m_numLights * 3 );
718
718
719
- m_diffuseIntensity.segment <3 >(0 ) << 0.9 , 0.0 , 0.0 ;
720
- m_specularIntensity.segment <3 >(0 ) << 1.0 , 1.0 , 1.0 ;
721
- m_lightPosition.segment <3 >(0 ) << -10.0 , 10.0 , 10.0 ;
719
+ m_diffuseIntensity.segment <3 >(0 ) << 0 .9f , 0 .0f , 0 .0f ;
720
+ m_specularIntensity.segment <3 >(0 ) << 1 .0f , 1 .0f , 1 .0f ;
721
+ m_lightPosition.segment <3 >(0 ) << -10 .0f , 10 .0f , 10 .0f ;
722
722
723
- m_diffuseIntensity.segment <3 >(1 * 3 ) << 0.0 , 0.0 , 0.9 ;
724
- m_specularIntensity.segment <3 >(1 * 3 ) << 1.0 , 1.0 , 1.0 ;
725
- m_lightPosition.segment <3 >(1 * 3 ) << 10.0 , 10.0 , 10.0 ;
723
+ m_diffuseIntensity.segment <3 >(1 * 3 ) << 0 .0f , 0 .0f , 0 .9f ;
724
+ m_specularIntensity.segment <3 >(1 * 3 ) << 1 .0f , 1 .0f , 1 .0f ;
725
+ m_lightPosition.segment <3 >(1 * 3 ) << 10 .0f , 10 .0f , 10 .0f ;
726
726
727
- m_diffuseIntensity.segment <3 >(2 * 3 ) << 0.0 , 0.9 , 0.0 ;
728
- m_specularIntensity.segment <3 >(2 * 3 ) << 1.0 , 1.0 , 1.0 ;
729
- m_lightPosition.segment <3 >(2 * 3 ) << 0.0 , 10.0 , 10.0 ;
727
+ m_diffuseIntensity.segment <3 >(2 * 3 ) << 0 .0f , 0 .9f , 0 .0f ;
728
+ m_specularIntensity.segment <3 >(2 * 3 ) << 1 .0f , 1 .0f , 1 .0f ;
729
+ m_lightPosition.segment <3 >(2 * 3 ) << 0 .0f , 10 .0f , 10 .0f ;
730
730
}
731
731
732
732
void MiniGL::initShaders (const std::string& shaderPath)
@@ -811,22 +811,20 @@ void MiniGL::disableScreenShader()
811
811
shader.end ();
812
812
}
813
813
814
- void MiniGL::supplyVectors (GLuint index, GLuint vbo, unsigned int dim, unsigned int n, const Real * data)
814
+ void MiniGL::supplyVectors (GLuint index, GLuint vbo, unsigned int dim, unsigned int n, const float * data)
815
815
{
816
816
glBindBuffer (GL_ARRAY_BUFFER, vbo);
817
- glBufferData (GL_ARRAY_BUFFER, n * dim * sizeof (Real ), data, GL_STREAM_DRAW);
818
- glVertexAttribPointer (index, dim, GL_REAL , GL_FALSE, 0 , (void *)0 );
817
+ glBufferData (GL_ARRAY_BUFFER, n * dim * sizeof (float ), data, GL_STREAM_DRAW);
818
+ glVertexAttribPointer (index, dim, GL_FLOAT , GL_FALSE, 0 , (void *)0 );
819
819
glEnableVertexAttribArray (index);
820
820
}
821
821
822
- void MiniGL::supplyVertices (GLuint index, unsigned int numVectors, const Real * data)
822
+ void MiniGL::supplyVectors (GLuint index, GLuint vbo, unsigned int dim, unsigned int n, const double * data)
823
823
{
824
- supplyVectors (index, m_vbo_vertices, 3 , numVectors, data);
825
- }
826
-
827
- void MiniGL::supplyNormals (GLuint index, unsigned int numVectors, const Real* data)
828
- {
829
- supplyVectors (index, m_vbo_normals, 3 , numVectors, data);
824
+ glBindBuffer (GL_ARRAY_BUFFER, vbo);
825
+ glBufferData (GL_ARRAY_BUFFER, n * dim * sizeof (double ), data, GL_STREAM_DRAW);
826
+ glVertexAttribPointer (index, dim, GL_DOUBLE, GL_FALSE, 0 , (void *)0 );
827
+ glEnableVertexAttribArray (index);
830
828
}
831
829
832
830
void MiniGL::supplyIndices (GLuint vbo, unsigned int n, const unsigned int * data)
@@ -835,11 +833,6 @@ void MiniGL::supplyIndices(GLuint vbo, unsigned int n, const unsigned int* data)
835
833
glBufferData (GL_ELEMENT_ARRAY_BUFFER, n * sizeof (unsigned int ), data, GL_STREAM_DRAW);
836
834
}
837
835
838
- void MiniGL::supplyFaces (unsigned int numIndices, const unsigned int * data)
839
- {
840
- supplyIndices (m_vbo_faces, numIndices, data);
841
- }
842
-
843
836
void MiniGL::move (Real x, Real y, Real z)
844
837
{
845
838
m_translation[0 ] += x;
0 commit comments