Browse Source

Rename OpenGL triangle example to triangle-opengl

Camilla Löwy 6 years ago
parent
commit
a639d6e635
4 changed files with 14 additions and 13 deletions
  1. 1 1
      .gitignore
  2. 8 7
      docs/quick.dox
  3. 3 3
      examples/CMakeLists.txt
  4. 2 2
      examples/triangle-opengl.c

+ 1 - 1
.gitignore

@@ -60,7 +60,7 @@ examples/offscreen
 examples/particles
 examples/splitview
 examples/sharing
-examples/simple
+examples/triangle-opengl
 examples/wave
 tests/*.app
 tests/*.exe

+ 8 - 7
docs/quick.dox

@@ -4,7 +4,7 @@
 
 @tableofcontents
 
-This guide takes you through writing a simple application using GLFW 3.  The
+This guide takes you through writing a small application using GLFW 3.  The
 application will create a window and OpenGL context, render a rotating triangle
 and exit when the user closes the window or presses _Escape_.  This guide will
 introduce a few of the most commonly used functions, but there are many more.
@@ -326,19 +326,20 @@ for example, many kinds of editing tools.
 @section quick_example Putting it together
 
 Now that you know how to initialize GLFW, create a window and poll for
-keyboard input, it's possible to create a simple program.
+keyboard input, it's possible to create a small program.
 
 This program creates a 640 by 480 windowed mode window and starts a loop that
 clears the screen, renders a triangle and processes events until the user either
 presses _Escape_ or closes the window.
 
-@snippet simple.c code
+@snippet triangle-opengl.c code
 
 The program above can be found in the
-[source package](https://www.glfw.org/download.html) as `examples/simple.c`
-and is compiled along with all other examples when you build GLFW.  If you
-built GLFW from the source package then already have this as `simple.exe` on
-Windows, `simple` on Linux or `simple.app` on macOS.
+[source package](https://www.glfw.org/download.html) as
+`examples/triangle-opengl.c` and is compiled along with all other examples when
+you build GLFW.  If you built GLFW from the source package then already have
+this as `triangle-opengl.exe` on Windows, `triangle-opengl` on Linux or
+`triangle-opengl.app` on macOS.
 
 This tutorial used only a few of the many functions GLFW provides.  There are
 guides for each of the areas covered by GLFW.  Each guide will introduce all the

+ 3 - 3
examples/CMakeLists.txt

@@ -36,8 +36,8 @@ add_executable(heightmap WIN32 MACOSX_BUNDLE heightmap.c ${ICON} ${GLAD_GL})
 add_executable(offscreen offscreen.c ${ICON} ${GLAD_GL})
 add_executable(particles WIN32 MACOSX_BUNDLE particles.c ${ICON} ${TINYCTHREAD} ${GETOPT} ${GLAD_GL})
 add_executable(sharing WIN32 MACOSX_BUNDLE sharing.c ${ICON} ${GLAD_GL})
-add_executable(simple WIN32 MACOSX_BUNDLE simple.c ${ICON} ${GLAD_GL})
 add_executable(splitview WIN32 MACOSX_BUNDLE splitview.c ${ICON} ${GLAD_GL})
+add_executable(triangle-opengl WIN32 MACOSX_BUNDLE triangle-opengl.c ${ICON} ${GLAD_GL})
 add_executable(wave WIN32 MACOSX_BUNDLE wave.c ${ICON} ${GLAD_GL})
 
 target_link_libraries(particles "${CMAKE_THREAD_LIBS_INIT}")
@@ -45,7 +45,7 @@ if (RT_LIBRARY)
     target_link_libraries(particles "${RT_LIBRARY}")
 endif()
 
-set(WINDOWS_BINARIES boing gears heightmap particles sharing simple splitview wave)
+set(WINDOWS_BINARIES boing gears heightmap particles sharing splitview triangle-opengl wave)
 set(CONSOLE_BINARIES offscreen)
 
 set_target_properties(${WINDOWS_BINARIES} ${CONSOLE_BINARIES} PROPERTIES
@@ -63,7 +63,7 @@ if (APPLE)
     set_target_properties(heightmap PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Heightmap")
     set_target_properties(particles PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Particles")
     set_target_properties(sharing PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Sharing")
-    set_target_properties(simple PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Simple")
+    set_target_properties(triangle-opengl PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "OpenGL Triangle")
     set_target_properties(splitview PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "SplitView")
     set_target_properties(wave PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Wave")
 

+ 2 - 2
examples/simple.c → examples/triangle-opengl.c

@@ -1,5 +1,5 @@
 //========================================================================
-// Simple GLFW example
+// OpenGL triangle example
 // Copyright (c) Camilla Löwy <[email protected]>
 //
 // This software is provided 'as-is', without any express or implied
@@ -87,7 +87,7 @@ int main(void)
     glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2);
     glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);
 
-    GLFWwindow* window = glfwCreateWindow(640, 480, "Simple example", NULL, NULL);
+    GLFWwindow* window = glfwCreateWindow(640, 480, "OpenGL Triangle", NULL, NULL);
     if (!window)
     {
         glfwTerminate();