From 8db2ecf34ad9310aec9de110921f9bb6a666b540 Mon Sep 17 00:00:00 2001 From: mayankzach <100225968+mayankzach@users.noreply.github.com> Date: Fri, 15 Jul 2022 18:12:32 +0530 Subject: [PATCH] Add files via upload --- .gitattributes | 63 +++++++++++++++ main.cpp | 94 ++++++++++++++++++++++ name_opengl.sln | 31 ++++++++ name_opengl.vcxproj | 155 ++++++++++++++++++++++++++++++++++++ name_opengl.vcxproj.filters | 22 +++++ name_opengl.vcxproj.user | 4 + 6 files changed, 369 insertions(+) create mode 100644 .gitattributes create mode 100644 main.cpp create mode 100644 name_opengl.sln create mode 100644 name_opengl.vcxproj create mode 100644 name_opengl.vcxproj.filters create mode 100644 name_opengl.vcxproj.user diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..b7d4ef6 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,63 @@ +############################################################################### +# Set default behavior to automatically normalize line endings. +############################################################################### +* text=auto + +############################################################################### +# Set default behavior for command prompt diff. +# +# This is need for earlier builds of msysgit that does not have it on by +# default for csharp files. +# Note: This is only used by command line +############################################################################### +#*.cs diff=csharp + +############################################################################### +# Set the merge driver for project and solution files +# +# Merging from the command prompt will add diff markers to the files if there +# are conflicts (Merging from VS is not affected by the settings below, in VS +# the diff markers are never inserted). Diff markers may cause the following +# file extensions to fail to load in VS. An alternative would be to treat +# these files as binary and thus will always conflict and require user +# intervention with every merge. To do so, just uncomment the entries below +############################################################################### +#*.sln merge=binary +#*.csproj merge=binary +#*.vbproj merge=binary +#*.vcxproj merge=binary +#*.vcproj merge=binary +#*.dbproj merge=binary +#*.fsproj merge=binary +#*.lsproj merge=binary +#*.wixproj merge=binary +#*.modelproj merge=binary +#*.sqlproj merge=binary +#*.wwaproj merge=binary + +############################################################################### +# behavior for image files +# +# image files are treated as binary by default. +############################################################################### +#*.jpg binary +#*.png binary +#*.gif binary + +############################################################################### +# diff behavior for common document formats +# +# Convert binary document formats to text before diffing them. This feature +# is only available from the command line. Turn it on by uncommenting the +# entries below. +############################################################################### +#*.doc diff=astextplain +#*.DOC diff=astextplain +#*.docx diff=astextplain +#*.DOCX diff=astextplain +#*.dot diff=astextplain +#*.DOT diff=astextplain +#*.pdf diff=astextplain +#*.PDF diff=astextplain +#*.rtf diff=astextplain +#*.RTF diff=astextplain diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..6706ae8 --- /dev/null +++ b/main.cpp @@ -0,0 +1,94 @@ +#include + +int main(void) +{ + GLFWwindow* window; + + /* Initialize the library */ + if (!glfwInit()) + return -1; + + /* Create a windowed mode window and its OpenGL context */ + window = glfwCreateWindow(640, 480, "Hello World", NULL, NULL); + if (!window) + { + glfwTerminate(); + return -1; + } + + /* Make the window's context current */ + glfwMakeContextCurrent(window); + + /* Loop until the user closes the window */ + while (!glfwWindowShouldClose(window)) + { + /* Render here */ + glClear(GL_COLOR_BUFFER_BIT); + glColor3f(1.0, 1.0, 0); + glBegin(GL_LINE_STRIP); + glVertex2f(-0.97f, 0.0f); + glVertex2f(-0.97f, 0.4f); + glVertex2f(-0.87f, 0.2f); + glVertex2f(-0.77f, 0.4f); + glVertex2f(-0.77f, 0.0f); + glEnd(); + glColor3f(1.0, 1.0, 1.0); + glBegin(GL_LINE_STRIP); + glVertex2f(-0.75f, 0.0f); + glVertex2f(-0.70f, 0.4f); + glVertex2f(-0.65f, 0.0f); + glEnd(); + glBegin(GL_LINES); + glVertex2f(-0.725f, 0.2f); + glVertex2f(-0.675f, 0.2f); + glEnd(); + glColor3f(1.0, 0, 0); + glBegin(GL_LINES); + glVertex2f(-0.6f, 0.0f); + glVertex2f(-0.6f, 0.2f); + glVertex2f(-0.65f, 0.4f); + glVertex2f(-0.6f, 0.2f); + glVertex2f(-0.55f, 0.4f); + glVertex2f(-0.6f, 0.2f); + glEnd(); + glColor3f(0, 0, 1.0); + glBegin(GL_LINE_STRIP); + glVertex2f(-0.55f, 0.0f); + glVertex2f(-0.50f, 0.4f); + glVertex2f(-0.45f, 0.0f); + glEnd(); + glBegin(GL_LINES); + glVertex2f(-0.525f, 0.2f); + glVertex2f(-0.475f, 0.2f); + glEnd(); + glColor3f(0, 1.0, 0); + glBegin(GL_LINE_STRIP); + glVertex2f(-0.40f, 0.0f); + glVertex2f(-0.40f, 0.4f); + glVertex2f(-0.30f, 0.0f); + glVertex2f(-0.30f, 0.4f); + glEnd(); + glColor3f(0, 1.0, 1.0); + glBegin(GL_LINES); + glVertex2f(-0.25f, 0.0f); + glVertex2f(-0.25f, 0.4f); + glEnd(); + glBegin(GL_LINE_STRIP); + glVertex2f(-0.15f, 0.0f); + glVertex2f(-0.25f, 0.2f); + glVertex2f(-0.15f, 0.4f); + glEnd(); + + + + + /* Swap front and back buffers */ + glfwSwapBuffers(window); + + /* Poll for and process events */ + glfwPollEvents(); + } + + glfwTerminate(); + return 0; +} \ No newline at end of file diff --git a/name_opengl.sln b/name_opengl.sln new file mode 100644 index 0000000..a510413 --- /dev/null +++ b/name_opengl.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.1.32421.90 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "name_opengl", "name_opengl.vcxproj", "{5B864A86-7606-4B25-A963-8635128539A6}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {5B864A86-7606-4B25-A963-8635128539A6}.Debug|x64.ActiveCfg = Debug|x64 + {5B864A86-7606-4B25-A963-8635128539A6}.Debug|x64.Build.0 = Debug|x64 + {5B864A86-7606-4B25-A963-8635128539A6}.Debug|x86.ActiveCfg = Debug|Win32 + {5B864A86-7606-4B25-A963-8635128539A6}.Debug|x86.Build.0 = Debug|Win32 + {5B864A86-7606-4B25-A963-8635128539A6}.Release|x64.ActiveCfg = Release|x64 + {5B864A86-7606-4B25-A963-8635128539A6}.Release|x64.Build.0 = Release|x64 + {5B864A86-7606-4B25-A963-8635128539A6}.Release|x86.ActiveCfg = Release|Win32 + {5B864A86-7606-4B25-A963-8635128539A6}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {1CEE69D2-2AF2-4962-B39A-6785AA311C58} + EndGlobalSection +EndGlobal diff --git a/name_opengl.vcxproj b/name_opengl.vcxproj new file mode 100644 index 0000000..76d5fea --- /dev/null +++ b/name_opengl.vcxproj @@ -0,0 +1,155 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + Win32Proj + {5b864a86-7606-4b25-a963-8635128539a6} + nameopengl + 10.0 + + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + false + + + true + + + false + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + C:\Users\mayan\OneDrive\Documents\glfw-3.3.7.bin.WIN64\include;%(AdditionalIncludeDirectories) + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + C:\Users\mayan\OneDrive\Documents\glfw-3.3.7.bin.WIN64\include;%(AdditionalIncludeDirectories) + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + C:\Users\mayan\OneDrive\Documents\glfw-3.3.7.bin.WIN64\include;%(AdditionalIncludeDirectories) + + + Console + true + C:\Users\mayan\OneDrive\Documents\glfw-3.3.7.bin.WIN64\lib-vc2022;%(AdditionalLibraryDirectories) + glfw3.lib;opengl32.lib;user32.lib;gdi32.lib;shell32.lib;%(AdditionalDependencies) + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + C:\Users\mayan\OneDrive\Documents\glfw-3.3.7.bin.WIN64\include;%(AdditionalIncludeDirectories) + + + Console + true + true + true + C:\Users\mayan\OneDrive\Documents\glfw-3.3.7.bin.WIN64\lib-vc2022;%(AdditionalLibraryDirectories) + glfw3.lib;opengl32.lib;user32.lib;gdi32.lib;shell32.lib;%(AdditionalDependencies) + + + + + + + + + \ No newline at end of file diff --git a/name_opengl.vcxproj.filters b/name_opengl.vcxproj.filters new file mode 100644 index 0000000..56d4d70 --- /dev/null +++ b/name_opengl.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Source Files + + + \ No newline at end of file diff --git a/name_opengl.vcxproj.user b/name_opengl.vcxproj.user new file mode 100644 index 0000000..0f14913 --- /dev/null +++ b/name_opengl.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file