integrated mesh import class into OpenGL,

Problem with STRP, indices are not logical
This commit is contained in:
Anakin
2016-10-16 12:33:25 +02:00
parent b2f174d15f
commit 9700638548
4 changed files with 147 additions and 44 deletions

View File

@@ -8,6 +8,7 @@
#include "shader.hpp"
#include "import.h"
#include "Texture.h"
#include "Object.h"
#define VERTEX_SHADER "Shader/VertexTextureShader.mv2shdr"
#define FRAGMENT_SHADER "Shader/FragmentTextureShader.mv2shdr"
@@ -280,8 +281,21 @@ void OpenGLController::loadMsh(const char * path)
gluiSamplerID = glGetUniformLocation(gluiShaderPrgmID, "textureSampler");
// get data
vfVertices = loadData();
vfUV = loadUV();
try
{
Object obj(path);
vfVertices = obj.getVertex();
vfUV = obj.getUV();
}
catch (std::invalid_argument e)
{
MessageBox(NULL, e.what(), "MeshViewer 2.0 Error", MB_OK | MB_ICONERROR);
exit(1);
}
//vfVertices = loadData();
//vfUV = loadUV();
glGenTextures(1, &gluiTextureID);
glBindTexture(GL_TEXTURE_2D, gluiTextureID);