Replace GLFloat with float

Remove unimplemented function
This commit is contained in:
2022-04-03 23:54:10 -07:00
parent 2f104edf7c
commit 1877049526
11 changed files with 42 additions and 44 deletions

View File

@@ -114,8 +114,6 @@ public:
KRSurfaceManager* getSurfaceManager();
KRDeviceManager* getDeviceManager();
KRCamera *createCamera(int width, int height);
enum {
KRENGINE_GL_EXT_texture_storage,
KRENGINE_NUM_EXTENSIONS

View File

@@ -48,8 +48,8 @@ KRMaterial::KRMaterial(KRContext &context, const char *szName) : KRResource(cont
m_diffuseColor = Vector3::One();
m_specularColor = Vector3::One();
m_reflectionColor = Vector3::Zero();
m_tr = (GLfloat)1.0f;
m_ns = (GLfloat)0.0f;
m_tr = 1.0f;
m_ns = 0.0f;
m_ambientMap = "";
m_diffuseMap = "";
m_specularMap = "";
@@ -202,14 +202,14 @@ void KRMaterial::setReflection(const Vector3 &c) {
m_reflectionColor = c;
}
void KRMaterial::setTransparency(GLfloat a) {
void KRMaterial::setTransparency(float a) {
if(a < 1.0f && m_alpha_mode == KRMaterial::KRMATERIAL_ALPHA_MODE_OPAQUE) {
setAlphaMode(KRMaterial::KRMATERIAL_ALPHA_MODE_BLENDONESIDE);
}
m_tr = a;
}
void KRMaterial::setShininess(GLfloat s) {
void KRMaterial::setShininess(float s) {
m_ns = s;
}
@@ -329,8 +329,8 @@ bool KRMaterial::bind(KRCamera *pCamera, std::vector<KRPointLight *> &point_ligh
// Bind bones
if(pShader->m_uniforms[KRPipeline::KRENGINE_UNIFORM_BONE_TRANSFORMS] != -1) {
GLfloat bone_mats[256 * 16];
GLfloat *bone_mat_component = bone_mats;
float bone_mats[256 * 16];
float *bone_mat_component = bone_mats;
for(int bone_index=0; bone_index < bones.size(); bone_index++) {
KRBone *bone = bones[bone_index];

View File

@@ -73,8 +73,8 @@ public:
void setDiffuse(const Vector3 &c);
void setSpecular(const Vector3 &c);
void setReflection(const Vector3 &c);
void setTransparency(GLfloat a);
void setShininess(GLfloat s);
void setTransparency(float a);
void setShininess(float s);
void setAlphaMode(alpha_mode_type blend_mode);
alpha_mode_type getAlphaMode();
@@ -121,13 +121,13 @@ private:
Vector3 m_specularColor; // Specular rgb
Vector3 m_reflectionColor; // Reflection rgb
//GLfloat m_ka_r, m_ka_g, m_ka_b; // Ambient rgb
//GLfloat m_kd_r, m_kd_g, m_kd_b; // Diffuse rgb
//GLfloat m_ks_r, m_ks_g, m_ks_b; // Specular rgb
//GLfloat m_kr_r, m_kr_g, m_kr_b; // Reflection rgb
//float m_ka_r, m_ka_g, m_ka_b; // Ambient rgb
//float m_kd_r, m_kd_g, m_kd_b; // Diffuse rgb
//float m_ks_r, m_ks_g, m_ks_b; // Specular rgb
//float m_kr_r, m_kr_g, m_kr_b; // Reflection rgb
GLfloat m_tr; // Transparency
GLfloat m_ns; // Shininess
float m_tr; // Transparency
float m_ns; // Shininess
alpha_mode_type m_alpha_mode;

View File

@@ -308,8 +308,8 @@ void KRMesh::render(VkCommandBuffer& commandBuffer, const std::string &object_na
}
}
GLfloat KRMesh::getMaxDimension() {
GLfloat m = 0.0;
float KRMesh::getMaxDimension() {
float m = 0.0;
if(m_maxPoint.x - m_minPoint.x > m) m = m_maxPoint.x - m_minPoint.x;
if(m_maxPoint.y - m_minPoint.y > m) m = m_maxPoint.y - m_minPoint.y;
if(m_maxPoint.z - m_minPoint.z > m) m = m_maxPoint.z - m_minPoint.z;

View File

@@ -129,7 +129,7 @@ public:
void renderSubmesh(VkCommandBuffer& commandBuffer, int iSubmesh, KRNode::RenderPass renderPass, const std::string &object_name, const std::string &material_name, float lodCoverage);
GLfloat getMaxDimension();
float getMaxDimension();
Vector3 getMinPoint() const;
Vector3 getMaxPoint() const;

View File

@@ -56,7 +56,7 @@ void KRMeshManager::init() {
addModel(new KRMeshSphere(*m_pContext));
// ---- Initialize stock models ----
static const GLfloat _KRENGINE_VBO_3D_CUBE_VERTEX_DATA[] = {
static const float _KRENGINE_VBO_3D_CUBE_VERTEX_DATA[] = {
1.0, 1.0, 1.0,
-1.0, 1.0, 1.0,
1.0,-1.0, 1.0,
@@ -74,9 +74,9 @@ void KRMeshManager::init() {
};
KRENGINE_VBO_3D_CUBE_ATTRIBS = (1 << KRMesh::KRENGINE_ATTRIB_VERTEX);
KRENGINE_VBO_3D_CUBE_VERTICES.expand(sizeof(GLfloat) * 3 * 14);
KRENGINE_VBO_3D_CUBE_VERTICES.expand(sizeof(float) * 3 * 14);
KRENGINE_VBO_3D_CUBE_VERTICES.lock();
memcpy(KRENGINE_VBO_3D_CUBE_VERTICES.getStart(), _KRENGINE_VBO_3D_CUBE_VERTEX_DATA, sizeof(GLfloat) * 3 * 14);
memcpy(KRENGINE_VBO_3D_CUBE_VERTICES.getStart(), _KRENGINE_VBO_3D_CUBE_VERTEX_DATA, sizeof(float) * 3 * 14);
KRENGINE_VBO_3D_CUBE_VERTICES.unlock();
KRENGINE_VBO_DATA_3D_CUBE_VERTICES.init(this, KRENGINE_VBO_3D_CUBE_VERTICES, KRENGINE_VBO_3D_CUBE_INDEXES, KRENGINE_VBO_3D_CUBE_ATTRIBS, false, KRVBOData::CONSTANT
@@ -87,16 +87,16 @@ void KRMeshManager::init() {
static const GLfloat _KRENGINE_VBO_2D_SQUARE_VERTEX_DATA[] = {
static const float _KRENGINE_VBO_2D_SQUARE_VERTEX_DATA[] = {
-1.0f, -1.0f, 0.0f, 0.0f, 0.0f,
1.0f, -1.0f, 0.0f, 1.0f, 0.0f,
-1.0f, 1.0f, 0.0f, 0.0f, 1.0f,
1.0f, 1.0f, 0.0f, 1.0f, 1.0f
};
KRENGINE_VBO_2D_SQUARE_ATTRIBS = (1 << KRMesh::KRENGINE_ATTRIB_VERTEX) | (1 << KRMesh::KRENGINE_ATTRIB_TEXUVA);
KRENGINE_VBO_2D_SQUARE_VERTICES.expand(sizeof(GLfloat) * 5 * 4);
KRENGINE_VBO_2D_SQUARE_VERTICES.expand(sizeof(float) * 5 * 4);
KRENGINE_VBO_2D_SQUARE_VERTICES.lock();
memcpy(KRENGINE_VBO_2D_SQUARE_VERTICES.getStart(), _KRENGINE_VBO_2D_SQUARE_VERTEX_DATA, sizeof(GLfloat) * 5 * 4);
memcpy(KRENGINE_VBO_2D_SQUARE_VERTICES.getStart(), _KRENGINE_VBO_2D_SQUARE_VERTEX_DATA, sizeof(float) * 5 * 4);
KRENGINE_VBO_2D_SQUARE_VERTICES.unlock();
KRENGINE_VBO_DATA_2D_SQUARE_VERTICES.init(this, KRENGINE_VBO_2D_SQUARE_VERTICES, KRENGINE_VBO_2D_SQUARE_INDEXES, KRENGINE_VBO_2D_SQUARE_ATTRIBS, false, KRVBOData::CONSTANT
@@ -362,32 +362,32 @@ KRDataBlock &KRMeshManager::getVolumetricLightingVertexes()
for(int iPlane=0; iPlane < KRENGINE_MAX_VOLUMETRIC_PLANES; iPlane++) {
vertex_data[iVertex].vertex.x = -1.0f;
vertex_data[iVertex].vertex.y = -1.0f;
vertex_data[iVertex].vertex.z = (GLfloat)iPlane;
vertex_data[iVertex].vertex.z = (float)iPlane;
iVertex++;
vertex_data[iVertex].vertex.x = 1.0f;
vertex_data[iVertex].vertex.y = -1.0f;
vertex_data[iVertex].vertex.z = (GLfloat)iPlane;
vertex_data[iVertex].vertex.z = (float)iPlane;
iVertex++;
vertex_data[iVertex].vertex.x = -1.0f;
vertex_data[iVertex].vertex.y = 1.0f;
vertex_data[iVertex].vertex.z = (GLfloat)iPlane;
vertex_data[iVertex].vertex.z = (float)iPlane;
iVertex++;
vertex_data[iVertex].vertex.x = -1.0f;
vertex_data[iVertex].vertex.y = 1.0f;
vertex_data[iVertex].vertex.z = (GLfloat)iPlane;
vertex_data[iVertex].vertex.z = (float)iPlane;
iVertex++;
vertex_data[iVertex].vertex.x = 1.0f;
vertex_data[iVertex].vertex.y = -1.0f;
vertex_data[iVertex].vertex.z = (GLfloat)iPlane;
vertex_data[iVertex].vertex.z = (float)iPlane;
iVertex++;
vertex_data[iVertex].vertex.x = 1.0f;
vertex_data[iVertex].vertex.y = 1.0f;
vertex_data[iVertex].vertex.z = (GLfloat)iPlane;
vertex_data[iVertex].vertex.z = (float)iPlane;
iVertex++;
}

View File

@@ -737,10 +737,10 @@ bool KRPipeline::bind(KRCamera &camera, const KRViewport &viewport, const Matrix
if(m_uniforms[KRENGINE_UNIFORM_VIEWPORT] != -1) {
setUniform(KRENGINE_UNIFORM_VIEWPORT, Vector4::Create(
(GLfloat)0.0,
(GLfloat)0.0,
(GLfloat)viewport.getSize().x,
(GLfloat)viewport.getSize().y
(float)0.0,
(float)0.0,
(float)viewport.getSize().x,
(float)viewport.getSize().y
)
);
}

View File

@@ -234,9 +234,9 @@ void KRPointLight::generateMesh() {
}
}
m_sphereVertices = (GLfloat *)malloc(sizeof(GLfloat) * m_cVertices * 3);
m_sphereVertices = (float*)malloc(sizeof(float) * m_cVertices * 3);
assert(m_sphereVertices != NULL);
GLfloat *pDest = m_sphereVertices;
float*pDest = m_sphereVertices;
for(int facet_index=0; facet_index < facet_count; facet_index++) {
*pDest++ = f[facet_index].p1.x;
*pDest++ = f[facet_index].p1.y;

View File

@@ -49,7 +49,7 @@ public:
private:
void generateMesh();
GLfloat *m_sphereVertices;
float *m_sphereVertices;
int m_cVertices;
};

View File

@@ -1685,8 +1685,8 @@ KRNode *LoadCamera(KRNode *parent_node, FbxNode* pNode) {
}
KRNode *LoadLight(KRNode *parent_node, FbxNode* pNode) {
const GLfloat PI = 3.14159265;
const GLfloat d2r = PI * 2 / 360;
const float PI = 3.14159265;
const float d2r = PI * 2 / 360;
FbxLight* pLight = (FbxLight*) pNode->GetNodeAttribute();
const char *szName = pNode->GetName();

View File

@@ -35,7 +35,7 @@
#include "KRMesh.h"
#include "KRDataBlock.h"
/*
static const GLfloat _KRENGINE_VBO_3D_CUBE_VERTEX_DATA[] = {
static const float _KRENGINE_VBO_3D_CUBE_VERTEX_DATA[] = {
1.0, 1.0, 1.0,
-1.0, 1.0, 1.0,
1.0,-1.0, 1.0,
@@ -53,11 +53,11 @@ static const GLfloat _KRENGINE_VBO_3D_CUBE_VERTEX_DATA[] = {
};
static KRDataBlock KRENGINE_VBO_3D_CUBE_VERTICES, KRENGINE_VBO_3D_CUBE_INDEXES;
KRENGINE_VBO_3D_CUBE_VERTICES.load((void *)_KRENGINE_VBO_3D_CUBE_VERTEX_DATA, sizeof(GLfloat) * 3 * 14);
KRENGINE_VBO_3D_CUBE_VERTICES.load((void *)_KRENGINE_VBO_3D_CUBE_VERTEX_DATA, sizeof(float) * 3 * 14);
static const __int32_t KRENGINE_VBO_3D_CUBE_ATTRIBS = (1 << KRMesh::KRENGINE_ATTRIB_VERTEX);
static const GLfloat _KRENGINE_VBO_2D_SQUARE_VERTEX_DATA[] = {
static const float _KRENGINE_VBO_2D_SQUARE_VERTEX_DATA[] = {
-1.0f, -1.0f, 0.0f, 0.0f, 0.0f,
1.0f, -1.0f, 0.0f, 1.0f, 0.0f,
-1.0f, 1.0f, 0.0f, 0.0f, 1.0f,
@@ -65,7 +65,7 @@ static const GLfloat _KRENGINE_VBO_2D_SQUARE_VERTEX_DATA[] = {
};
static KRDataBlock KRENGINE_VBO_2D_SQUARE_VERTICES, KRENGINE_VBO_2D_SQUARE_INDEXES;
KRENGINE_VBO_2D_SQUARE_VERTICES.load((void *)_KRENGINE_VBO_2D_SQUARE_VERTEX_DATA, sizeof(GLfloat) * 5 * 4);
KRENGINE_VBO_2D_SQUARE_VERTICES.load((void *)_KRENGINE_VBO_2D_SQUARE_VERTEX_DATA, sizeof(float) * 5 * 4);
static const __int32_t KRENGINE_VBO_2D_SQUARE_ATTRIBS = (1 << KRMesh::KRENGINE_ATTRIB_VERTEX) | (1 << KRMesh::KRENGINE_ATTRIB_TEXUVA);
*/
#endif