From b02eed3e4963c6ba337fd286dc3a2e2496dd8678 Mon Sep 17 00:00:00 2001 From: omar Date: Wed, 3 Dec 2014 18:29:46 +0000 Subject: [PATCH] Examples: adding title to the top of each examples. Cleaning up file headers. --- examples/directx11_example/main.cpp | 2 ++ .../directx9_example/directx9_example.vcxproj | 6 ++++++ .../directx9_example.vcxproj.filters | 17 ++++++++++++++++ examples/directx9_example/main.cpp | 2 ++ examples/opengl3_example/main.cpp | 20 +++++++++++-------- examples/opengl_example/main.cpp | 17 +++++++--------- 6 files changed, 46 insertions(+), 18 deletions(-) diff --git a/examples/directx11_example/main.cpp b/examples/directx11_example/main.cpp index bb24c73b7..95b029203 100644 --- a/examples/directx11_example/main.cpp +++ b/examples/directx11_example/main.cpp @@ -1,3 +1,5 @@ +// ImGui - standalone example application for DirectX 11 + #include #define STB_IMAGE_IMPLEMENTATION #include "../shared/stb_image.h" // for .png loading diff --git a/examples/directx9_example/directx9_example.vcxproj b/examples/directx9_example/directx9_example.vcxproj index 512d86e17..5609b7569 100644 --- a/examples/directx9_example/directx9_example.vcxproj +++ b/examples/directx9_example/directx9_example.vcxproj @@ -70,8 +70,14 @@ + + + + + + diff --git a/examples/directx9_example/directx9_example.vcxproj.filters b/examples/directx9_example/directx9_example.vcxproj.filters index f18cb00d8..f39e15892 100644 --- a/examples/directx9_example/directx9_example.vcxproj.filters +++ b/examples/directx9_example/directx9_example.vcxproj.filters @@ -5,10 +5,27 @@ {4FC737F1-C7A5-4376-A066-2A32D752A2FF} cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + {a82cba23-9de0-45c2-b1e3-2eb1666702de} + sources + + imgui + + + + + imgui + + + imgui + + + imgui + \ No newline at end of file diff --git a/examples/directx9_example/main.cpp b/examples/directx9_example/main.cpp index dc86c3c04..9da31d2f5 100644 --- a/examples/directx9_example/main.cpp +++ b/examples/directx9_example/main.cpp @@ -1,3 +1,5 @@ +// ImGui - standalone example application for DirectX 9 + #include #include "../../imgui.h" diff --git a/examples/opengl3_example/main.cpp b/examples/opengl3_example/main.cpp index 6d5304fe3..e2f2442ee 100644 --- a/examples/opengl3_example/main.cpp +++ b/examples/opengl3_example/main.cpp @@ -1,19 +1,24 @@ -#define GLEW_STATIC -#include -#include -#define STB_IMAGE_IMPLEMENTATION -#include "../shared/stb_image.h" // for .png loading -#include "../../imgui.h" +// ImGui - standalone example application for OpenGL 3, using programmable pipeline + #ifdef _MSC_VER #pragma warning (disable: 4996) // 'This function or variable may be unsafe': strcpy, strdup, sprintf, vsnprintf, sscanf, fopen #endif +#include "../../imgui.h" +#define STB_IMAGE_IMPLEMENTATION +#include "../shared/stb_image.h" // stb_image.h for PNG loading + +// Glfw/Glew +#define GLEW_STATIC +#include +#include + static GLFWwindow* window; static GLuint fontTex; static bool mousePressed[2] = { false, false }; static ImVec2 mousePosScale(1.0f, 1.0f); -//Shader variables +// Shader variables static int shader_handle, vert_handle, frag_handle; static int texture_location, ortho_location; @@ -25,7 +30,6 @@ static int position_location, uv_location, colour_location; static size_t vbo_max_size = 1000000; static unsigned int vbo_handle, vao_handle; - // This is the main rendering function that you have to implement and provide to ImGui (via setting up 'RenderDrawListsFn' in the ImGuiIO structure) // If text or lines are blurry when integrating ImGui in your engine: // - try adjusting ImGui::GetIO().PixelCenterOffset to 0.0f or 0.5f diff --git a/examples/opengl_example/main.cpp b/examples/opengl_example/main.cpp index 61a9f3694..32ca0b9f8 100644 --- a/examples/opengl_example/main.cpp +++ b/examples/opengl_example/main.cpp @@ -1,20 +1,17 @@ +// ImGui - standalone example application for OpenGL 2, using fixed pipeline + #ifdef _MSC_VER #pragma warning (disable: 4996) // 'This function or variable may be unsafe': strcpy, strdup, sprintf, vsnprintf, sscanf, fopen -#include #endif -#define STB_IMAGE_IMPLEMENTATION -#include "../shared/stb_image.h" // for .png loading -#include "../../imgui.h" -// glew & glfw +#include "../../imgui.h" +#define STB_IMAGE_IMPLEMENTATION +#include "../shared/stb_image.h" // stb_image.h for PNG loading + +// Glfw/Glew #define GLEW_STATIC #include #include -#ifdef _MSC_VER -#define GLFW_EXPOSE_NATIVE_WIN32 -#define GLFW_EXPOSE_NATIVE_WGL -#include -#endif static GLFWwindow* window; static GLuint fontTex;