Beispiel #1
0
void Texture::loadResources()
{
	bikeTexture = loadTGATexture("textures/bike_text.tga");
	planeTexture = loadTGATexture("textures/square_plane.tga");
	
	std::vector<glm::vec3> vertices;
    std::vector<glm::vec3> normals;
    std::vector<glm::vec2> uvs;
	std::vector<glm::vec3> colors;	
	
	if(!Texture::loadOBJ("objs/bike.obj",vertices, uvs,normals))
	{
		printf("Error loading bike.obj\n");
	}

	indexVBO(vertices, uvs, normals, bikeModel.indices, bikeModel.vertices, bikeModel.uvs, bikeModel.normals); 	
}
Beispiel #2
0
void Texture::load()
{
  glGenTextures(1, &m_textureId);
  glBindTexture(GL_TEXTURE_2D, m_textureId);
  switch (m_format)
  {
    case PixmapFormat::TGA:
      loadTGATexture(m_minFilter, m_magFilter, m_wrapMode);
      break;
    case PixmapFormat::BMP:
      break;
  }
  
  CHECK_OPENGL_ERROR;
}