bug fixes
This commit is contained in:
parent
b682002ecd
commit
378806c0a0
3
.gitignore
vendored
3
.gitignore
vendored
@ -3,4 +3,5 @@ build*
|
|||||||
Makefile*
|
Makefile*
|
||||||
object_script.*
|
object_script.*
|
||||||
debug
|
debug
|
||||||
release
|
release
|
||||||
|
shaders.cpp
|
@ -1,8 +1,14 @@
|
|||||||
project(SparrowRenderer)
|
project(SparrowRenderer)
|
||||||
cmake_minimum_required(VERSION 2.8)
|
cmake_minimum_required(VERSION 2.8)
|
||||||
|
|
||||||
|
# choose resource files
|
||||||
|
file(GLOB RESOURCES_FILES src/*.h shaders/*.glsl)
|
||||||
|
FILE(GLOB RES_SRC_FILE shaders/*.glsl)
|
||||||
|
SET(RESOURCE_DST_FILE shaders.cpp)
|
||||||
|
|
||||||
# choose source file
|
# choose source file
|
||||||
file(GLOB LIB_SRC_LIST src/*.cpp src/glew.c)
|
file(GLOB LIB_SRC_LIST src/*.cpp src/glew.c)
|
||||||
|
list(APPEND LIB_SRC_LIST ${RESOURCE_DST_FILE})
|
||||||
file(GLOB LIB_HEAD_LIST src/*.h)
|
file(GLOB LIB_HEAD_LIST src/*.h)
|
||||||
|
|
||||||
#set compilation option
|
#set compilation option
|
||||||
@ -14,10 +20,6 @@ if(CMAKE_BUILD_TYPE MATCHES "Debug")
|
|||||||
add_definitions(-DRENDER_DEBUG)
|
add_definitions(-DRENDER_DEBUG)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
file(GLOB RESOURCES_FILES src/*.h shaders/*.glsl)
|
|
||||||
FILE(GLOB RES_SRC_FILE shaders/*.glsl)
|
|
||||||
SET(RESOURCE_DST_FILE shaders.cpp)
|
|
||||||
|
|
||||||
set(CMAKE_TEMPLATE_PATH "../cmaketemplate")
|
set(CMAKE_TEMPLATE_PATH "../cmaketemplate")
|
||||||
|
|
||||||
include(${CMAKE_TEMPLATE_PATH}/template.cmake)
|
include(${CMAKE_TEMPLATE_PATH}/template.cmake)
|
||||||
|
@ -60,7 +60,7 @@ void PhongMaterial::bindAttributes(Shader* myShader)
|
|||||||
diffuse_texture->bind(0);
|
diffuse_texture->bind(0);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
glActiveTexture(0);
|
glActiveTexture(GL_TEXTURE0);
|
||||||
glBindTexture(GL_TEXTURE_2D, 0);
|
glBindTexture(GL_TEXTURE_2D, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,12 +8,13 @@ class Texture;
|
|||||||
|
|
||||||
class PhongMaterial : public Material
|
class PhongMaterial : public Material
|
||||||
{
|
{
|
||||||
private:
|
public: // TODO add setters for this
|
||||||
glm::vec3 ambient;
|
glm::vec3 ambient;
|
||||||
glm::vec3 diffuse;
|
glm::vec3 diffuse;
|
||||||
glm::vec3 specular;
|
glm::vec3 specular;
|
||||||
float shininess;
|
float shininess;
|
||||||
bool castShadow;
|
bool castShadow;
|
||||||
|
private:
|
||||||
Texture* ambient_texture;
|
Texture* ambient_texture;
|
||||||
Texture* diffuse_texture;
|
Texture* diffuse_texture;
|
||||||
Texture* specular_texture;
|
Texture* specular_texture;
|
||||||
|
@ -19,7 +19,7 @@ SimplePipeline::SimplePipeline(ShaderSource *forwardSource)
|
|||||||
glEnable(GL_CULL_FACE);
|
glEnable(GL_CULL_FACE);
|
||||||
glEnable(GL_TEXTURE_2D);
|
glEnable(GL_TEXTURE_2D);
|
||||||
|
|
||||||
m_isCrappy = forwardSource != NULL && SparrowRenderer::isModernOpenGLAvailable();
|
m_isCrappy = !(forwardSource != NULL && SparrowRenderer::isModernOpenGLAvailable());
|
||||||
if(!m_isCrappy)
|
if(!m_isCrappy)
|
||||||
{
|
{
|
||||||
ForwardModule *forward = new ForwardModule();
|
ForwardModule *forward = new ForwardModule();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user