merge end stuff
This commit is contained in:
commit
6e6a28c9ff
5 changed files with 82 additions and 64 deletions
|
|
@ -78,11 +78,11 @@ namespace endofthejedi {
|
|||
NULL, NULL, NULL);
|
||||
|
||||
|
||||
if (color_type == PNG_COLOR_TYPE_RGB) {
|
||||
puts("PNG_COLOR_TYPE_RGB");
|
||||
} else if (color_type == PNG_COLOR_TYPE_RGBA) {
|
||||
puts("PNG_COLOR_TYPE_RGBA");
|
||||
}
|
||||
//if (color_type == PNG_COLOR_TYPE_RGB) {
|
||||
// puts("PNG_COLOR_TYPE_RGB");
|
||||
//} else if (color_type == PNG_COLOR_TYPE_RGBA) {
|
||||
// puts("PNG_COLOR_TYPE_RGBA");
|
||||
//}
|
||||
|
||||
//update width and height based on png info
|
||||
|
||||
|
|
@ -95,11 +95,11 @@ namespace endofthejedi {
|
|||
|
||||
m_size = glm::vec2();
|
||||
|
||||
puts("#########################################");
|
||||
printf("# PNG: width=%d, height=%d\n", twidth, theight);
|
||||
printf("# powers of two: w=%d, h=%d\n", pot_width, pot_height);
|
||||
printf("# uv scale two: x=%f, y=%f\n", m_uvScale.x, m_uvScale.y);
|
||||
puts("#########################################");
|
||||
//puts("#########################################");
|
||||
//printf("# PNG: width=%d, height=%d\n", twidth, theight);
|
||||
//printf("# powers of two: w=%d, h=%d\n", pot_width, pot_height);
|
||||
//printf("# uv scale two: x=%f, y=%f\n", m_uvScale.x, m_uvScale.y);
|
||||
//puts("#########################################");
|
||||
|
||||
// Update the png info struct.
|
||||
png_read_update_info(png_ptr, info_ptr);
|
||||
|
|
|
|||
|
|
@ -9,8 +9,7 @@
|
|||
#include "developer_console.hpp"
|
||||
|
||||
namespace endofthejedi {
|
||||
void RendererPolygon3d::setup()
|
||||
{
|
||||
void RendererPolygon3d::setup() {
|
||||
m_lastTime = -1.0;
|
||||
|
||||
//std::cout << "setup polygon 3d" << std::endl;
|
||||
|
|
@ -39,7 +38,7 @@ namespace endofthejedi {
|
|||
addModel("../data/mesh/ship_ufo.stl", &m_shipModel);
|
||||
|
||||
m_texture = nullptr;
|
||||
m_backgroundTexturePath = "../data/img/background_3.png";
|
||||
m_backgroundTexturePath = "../data/img/stars_nebular.png";
|
||||
loadBackgroundTexture();
|
||||
|
||||
m_postprocess_shader.init();
|
||||
|
|
@ -88,15 +87,15 @@ namespace endofthejedi {
|
|||
glActiveTexture(GL_TEXTURE0);
|
||||
m_texture->loadPng();
|
||||
|
||||
std::cout<<"texture loading: " << m_texture->valid() << std::endl;
|
||||
//std::cout<<"texture loading: " << m_texture->valid() << std::endl;
|
||||
if (!m_texture->valid()) {
|
||||
std::cout<<"loading failed!";
|
||||
return;
|
||||
//exit(-1);
|
||||
}
|
||||
|
||||
glm::vec2 s = m_texture->size();
|
||||
std::cout<<"texture size is " << s.x << " X " << s.y << std::endl;
|
||||
//glm::vec2 s = m_texture->size();
|
||||
//std::cout<<"texture size is " << s.x << " X " << s.y << std::endl;
|
||||
}
|
||||
|
||||
void RendererPolygon3d::renderBackgroundImage()
|
||||
|
|
@ -574,7 +573,7 @@ void RendererPolygon3d::renderMissiles() {
|
|||
glm::mat4 model = computeModelMatrix(ship);
|
||||
glUniformMatrix4fv(m_shader_game_objects.location("model"), 1, GL_FALSE, glm::value_ptr(model));
|
||||
|
||||
glm::vec3 c = ship->color;
|
||||
glm::vec3 c = glm::vec3(0.1, 1.0, 0.2);
|
||||
glUniform3f(m_shader_game_objects.location("materialColor"), c.x, c.y, c.z);
|
||||
|
||||
m_shipModel->render();
|
||||
|
|
@ -681,6 +680,7 @@ void RendererPolygon3d::renderMissiles() {
|
|||
}
|
||||
glEnd();
|
||||
}
|
||||
glLineWidth(1.0f);
|
||||
glPolygonMode(GL_FRONT, GL_FILL);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@ namespace endofthejedi {
|
|||
|
||||
private:
|
||||
void renderPlanets();
|
||||
void renderSun();
|
||||
void renderMissiles();
|
||||
void renderShips();
|
||||
void renderParticles();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue