Fixed heightmap example for OS X.

This commit is contained in:
Camilla Berglund 2015-01-06 18:15:16 +01:00
parent 40d1a491ca
commit 0e3cb945e8
2 changed files with 7 additions and 5 deletions

View File

@ -26,6 +26,7 @@ if (APPLE)
# Set fancy names for bundles # Set fancy names for bundles
add_executable(Boing MACOSX_BUNDLE boing.c) add_executable(Boing MACOSX_BUNDLE boing.c)
add_executable(Gears MACOSX_BUNDLE gears.c) add_executable(Gears MACOSX_BUNDLE gears.c)
add_executable(Heightmap MACOSX_BUNDLE heightmap.c ${GLAD})
add_executable(Particles MACOSX_BUNDLE particles.c ${TINYCTHREAD}) add_executable(Particles MACOSX_BUNDLE particles.c ${TINYCTHREAD})
add_executable(Simple MACOSX_BUNDLE simple.c) add_executable(Simple MACOSX_BUNDLE simple.c)
add_executable(SplitView MACOSX_BUNDLE splitview.c) add_executable(SplitView MACOSX_BUNDLE splitview.c)
@ -33,12 +34,13 @@ if (APPLE)
set_target_properties(Boing PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Boing") set_target_properties(Boing PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Boing")
set_target_properties(Gears PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Gears") set_target_properties(Gears PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Gears")
set_target_properties(Heightmap PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Heightmap")
set_target_properties(Particles PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Particles") set_target_properties(Particles PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Particles")
set_target_properties(Simple PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Simple") set_target_properties(Simple PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Simple")
set_target_properties(SplitView PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Split View") set_target_properties(SplitView PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Split View")
set_target_properties(Wave PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Wave") set_target_properties(Wave PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Wave")
set_target_properties(Boing Gears Particles Simple SplitView Wave PROPERTIES set_target_properties(Boing Gears Heightmap Particles Simple SplitView Wave PROPERTIES
FOLDER "GLFW3/Examples") FOLDER "GLFW3/Examples")
else() else()
# Set boring names for executables # Set boring names for executables
@ -69,7 +71,7 @@ if (MSVC)
endif() endif()
if (APPLE) if (APPLE)
set(BUNDLE_BINARIES Boing Gears Particles Simple SplitView Wave) set(BUNDLE_BINARIES Boing Gears Heightmap Particles Simple SplitView Wave)
set_target_properties(${BUNDLE_BINARIES} PROPERTIES set_target_properties(${BUNDLE_BINARIES} PROPERTIES
MACOSX_BUNDLE_SHORT_VERSION_STRING ${GLFW_VERSION} MACOSX_BUNDLE_SHORT_VERSION_STRING ${GLFW_VERSION}

View File

@ -66,10 +66,10 @@ static const char* vertex_shader_text =
static const char* fragment_shader_text = static const char* fragment_shader_text =
"#version 150\n" "#version 150\n"
"out vec4 gl_FragColor;\n" "out vec4 color;\n"
"void main()\n" "void main()\n"
"{\n" "{\n"
" gl_FragColor = vec4(0.2, 1.0, 0.2, 1.0); \n" " color = vec4(0.2, 1.0, 0.2, 1.0); \n"
"}\n"; "}\n";
/********************************************************************** /**********************************************************************
@ -418,7 +418,7 @@ int main(int argc, char** argv)
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2); glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_FALSE); glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
window = glfwCreateWindow(800, 600, "GLFW OpenGL3 Heightmap demo", NULL, NULL); window = glfwCreateWindow(800, 600, "GLFW OpenGL3 Heightmap demo", NULL, NULL);
if (! window ) if (! window )