Sign in to follow this  
Overv

OpenGL Is there a need for another modern OpenGL guide?

Recommended Posts

Hi,

[font=verdana, arial, helvetica, sans-serif][size=2]I'm thinking of writing a modern OpenGL guide. I realize that more and more modern OpenGL guides are popping up, but I think there are still things that most (if not all) of them lack:[/size][/font]
[font=verdana, arial, helvetica, sans-serif][size=2][list][*]A site that can be corrected and updated by users, e.g. a wiki.[*]Information for setting up your context in every language and platform (C++, C#, WebGL, Android, ...).[*]Bare-bones interaction, not letting libraries do everything for you. At least not in the beginning.[*]Beats NeHe's tutorials in Google's search results (I've registered [url="http://open.gl/"]http://open.gl[/url] for this exact purpose).[*]Including everything in one place. The current situation makes modern OpenGL too hard to learn.[/list]
I've come up with the following structure for the site I want to develop:

[url="http://codepad.org/4yH2kxLl"]http://codepad.org/4yH2kxLl[/url]




I'd like to hear your input.

[/size][/font]

Share this post


Link to post
Share on other sites
This is your first post on these forums and we don't know your level of expertise on the subject. Can you provide some references ? How many years have you been professionally working with OpenGL ? Do you have a proven track record in this domain, did you publish any publications ? Were/are you involved with the ex-ARB, Khronos or one of their major contributors ? Are you working on the GL driver development team of a major GPU manufacturer or of an open source driver ? Were you directly involved in the development of an OpenGL based rendering backend for a major game, application or middleware ?

If the answer to all of these questions is no, then you shouldn't be writing "another modern OpenGL guide".

Sorry for being so blunt, and I applaud your motivation. But the answer to your title question is, no, we don't need another such guide. What we do need is a single, authoritative development and learning resource for OpenGL, published and maintained by an officially endorsed and highly qualified organization. We don't need another open wiki, we don't need another gazillion of tutorials, we don't need to "beat" NeHe. We need Khronos to finally get their stuff together and release an actual OpenGL SDK and updated human-friendly documentation (ie. [i]not[/i] the extension doc text format). In other words, we need an MSDN equivalent for modern OpenGL.

So if you have some good ideas, then you should try to contribute to the more or less 'official' [url="http://www.opengl.org/wiki/Main_Page"]OpenGL wiki[/url] instead, helping to bring it out of its current desolate state.

Share this post


Link to post
Share on other sites
[quote name='Yann L' timestamp='1306025861' post='4814040']So if you have some good ideas, then you should try to contribute to the more or less 'official' [url="http://www.opengl.org/wiki/Main_Page"]OpenGL wiki[/url] instead, helping to bring it out of its current desolate state.[/quote]

I am afraid I won't be able to, as I do not currently have a PhD in graphics programming. Nor do I meet any of your other royal standards.

Share this post


Link to post
Share on other sites
[quote name='Yann L' timestamp='1306025861' post='4814040'] we need an MSDN equivalent for modern OpenGL. [/quote]


No

Are you under a delusion that OpenGL is so complex that it requires professional experience to simply explain it to beginners? Adding more crap to the pill of crap won't help, and waiting for someone else to do it is lazy, what harm could come from making another website that would not anyways happen from bogging down a already unhelpful website?


Share this post


Link to post
Share on other sites
[quote name='Overv' timestamp='1306026706' post='4814048']
I am afraid I won't be able to, as I do not currently have a PhD in graphics programming. Nor do I meet any of your other royal standards.
[/quote]
No need to get defensive. You are planning to write what basically amounts to a significant amount of teaching material targeting beginners. Well written teaching material can be an excellent resource, while badly written (often due to lack of knowledge) is highly counterproductive. Unfortunately, most online tutorials fall into the later category. As such it is absolutely valid to ask about your own expertise on the subject. If someone offered to teach me how to fly an airplane, I would inquire about his own license first.

[quote name='Polkm' timestamp='1306029623' post='4814066']
[quote name='Yann L' timestamp='1306025861' post='4814040'] we need an MSDN equivalent for modern OpenGL. [/quote]
No
Are you under a delusion that OpenGL is so complex that it requires professional experience to simply explain it to beginners?
[/quote]
Yes, absolutely. Significant experience is a prerequisite for teaching any form of advanced concept to a beginner. No need for a PhD, but if you don't know the material inside-out, then you have no business teaching it.

[quote]
Adding more crap to the pill of crap won't help, and waiting for someone else to do it is lazy, what harm could come from making another website that would not anyways happen from bogging down a already unhelpful website?
[/quote]
You mean like NeHe, for example ? Spreading incorrect information, even unintentionally, is worse than not spreading any information at all. I am not saying the OP is in this position, that's why I inquired about his experience with OpenGL.

Share this post


Link to post
Share on other sites
[quote name='Yann L' timestamp='1306025861' post='4814040']
In other words, we need an MSDN equivalent for modern OpenGL.
[/quote]


There are few things I want to see happen as badly as that.

I know that Microsoft is out of the question, but at the very least Apple should step up to the plate. They've done a pretty good job at creating very MSDN-like knowledge base for IOS development, among other things. My respect for Apple would increase drastically if they helped propel OpenGL as Microsoft did with DirectX, and with a market share over $300B they should have the money to blow away on increasing the standards of all the technologies their own software and operating systems rely on!

/anxious-to-see-opengl-truly-mature


I don't know what Polkm's deal is but he has clearly never used MSDN, I use it on a daily basis just about and can say with utmost confidence that he has no idea what he's talking about. Some examples; I was recently working on a C++ application to visualize music, and in that process I wanted to try and visualize audio playing through the system's audio endpoint, to get around having to play a specific MP3 or write a plug-in for an existing media player. So what I did is research the Windows 7 audio platform and architecture on MSDN, found the API's on MSDN, and even some sample code on MSDN, as well as ridiculously clear and intuitive information on how it was all connected (hell, they even create logical diagrams for you). Within a couple hours I had it all done and my software was running as I wanted, much simpler than it was for XP.

[url="http://gltiich.blogspot.com/2009/10/capture-system-speaker-audio-windows-7.html"]http://gltiich.blogs...-windows-7.html[/url]

Not long after that I bought some MIDI instruments, again, Microsoft documented everything so well and so clearly, that I was up and going with my own MIDI software to do some stuff for fun in just a couple hours (piecing everything together at first can be a bit slow hehe).

[url="http://gltiich.blogspot.com/2010/10/receiving-midi-controller-input-with-c.html"]http://gltiich.blogs...put-with-c.html[/url]

MSDN has STL C++ documentation, and even entire sections around clever/neat short-hand notations and tricks. Things I never found so well centralized or organized on C++ focused websites like cprogramming.com or cplusplus.com. After having been developing with C++ for years I came across those sections in MSDN and learned quite a few new things and even had better clarity on many features I didn't have before then.

Also all of their platforms are documented in detail and followed-up with technical and howto articles.

Learning OpenGL in contrast for me was a long and painful experience, specifications are not clear or intuitive. I spent years trial-and-error developing a lot of it and piecing together a lot of separate specification documents to build the 'whole picture' conceptually. I don't care who you are or how smart you think you are - that is not a good method to learn something, especially if you want broader acceptance out of the professional gaming industry.

An MSDN equivalent for OpenGL is exactly what OpenGL needs in order to have a foundation to back its marketing. OpenGL as a whole needs to grow up, not just it's API, but everything around it including a support base for future/new programmers.

Finally, clearly, Microsoft has a conflict of interest in supporting OpenGL, even though they do to a limited extent (documentation wise). But a major player that is as well as financed like Apple, that could really make this all happen, it must! >:]

Share this post


Link to post
Share on other sites
[quote name='Yann L' timestamp='1306030658' post='4814069']
Yes, absolutely. Significant experience is a prerequisite for teaching any form of advanced concept to a beginner. No need for a PhD, but if you don't know the material inside-out, then you have no business teaching it.
[/quote]


I agree, but that is not what you were saying before. You were asking for professional experience, significant and professional are different. I am not interested in a deep argument over linguistics though. I say no to MSDN because it has only minimal documentation, and rarely covers relevant application. When I was starting out, MSDN might as well have been written in Latin. Beginners often have to resort to tutorial websites because the documentation website was written, unintentionally, for people who already know how it works.

Share this post


Link to post
Share on other sites
why gamedev members like to derail threads to their own liking like this?


This guy has asked a clear question: "IS THERE A NEED FOR AN OGL GUIDE?"

I mean really its very clear.

And Im not talking bout this thread as a single example, many many times (including threads made by myself) this kind of behavior appears


And yeah, personally, Yes I think there is a need for an OGL guide that has no assumptions whatsoever . (well at least I need one xD)

Share this post


Link to post
Share on other sites
I thought Yann L's answer was pretty clear as well. If you don't have experience implementing most of the useful features of modern OpenGL in a professional or academic context as well as a thorough understanding of the graphics pipeline as implemented in current hardware, your efforts are likely to be only marginally better than what's already out there. If this is the case, the project is unlikely to become a "definitive guide", and your efforts are better served contributing to the existing wiki.

Share this post


Link to post
Share on other sites
[quote]I'm thinking of writing a modern OpenGL guide. I realize that more and more modern OpenGL guides are popping up, but I think there are still things that most (if not all) of them lack:
[list][*]A site that can be corrected and updated by users, e.g. a wiki.[*]Information for setting up your context in every language and platform (C++, C#, WebGL, Android, ...).[*]Bare-bones interaction, not letting libraries do everything for you. At least not in the beginning.[*]Beats NeHe's tutorials in Google's search results (I've registered [url="http://open.gl/"]http://open.gl[/url] for this exact purpose).[*]Including everything in one place. The current situation makes modern OpenGL too hard to learn[/list]I think that's great that you collected what other sites lack, and hats off to your enthusiasm. The question is can you make a tutorial site that can match the other sites, and correct these things you listed?
[/quote]

Personally I wouldn't care how deep you understand OpenGL, because as far as you don't write bulls..., and as far as it works I think anyone can write one.
I think noone can understand OpenGL as deeply as the people who created it, or belong to any of the categories Yann L listed, and for an "everyday guy" it is impossible to become one of them.
And I don't think those guys have time to write such sites.

I think these sites also lack the ability to present the concepts of developing an OpenGL based GAME ENGINE. I mean I don't really like to write samples all the time. So in that sense your site could be far better than the present ones.

So I do think there's a need, but only if you can meet those requirements you listed (and match the other sites).

Share this post


Link to post
Share on other sites
"Nor do I meet any of your other royal standards."

There are tons of opengl tutorials out there.

Every single one of those people started out with the best intentions. Sadly most of them are still learning OpenGL themselves and doing it as a hobby. So storming numbers of them talk about how to generate vertex buffers and mutter that you can use them for rendering things and then they sort of trail off at that point...

And as a result all they're doing is polluting the google results with duplicates of the introductory stuff that world+dog either knows or could learn from 2 chapters of the superbible. So when you actually go looking for something complicated, you can't find it.

Before agreeing it's a good idea, Yann is just attempting to if you belong to that group or if you're experienced and knowledgeable enough to increase the net information quality.

Share this post


Link to post
Share on other sites
[quote name='gltiich' timestamp='1306032457' post='4814080']
I don't know what Polkm's deal is but he has clearly never used MSDN, I use it on a daily basis just about and can say with utmost confidence that he has no idea what he's talking about. Some examples; I was recently working on a C++ application to visualize music, and in that process I wanted to try and visualize audio playing through the system's audio endpoint, to get around having to play a specific MP3 or write a plug-in for an existing media player. So what I did is research the Windows 7 audio platform and architecture on MSDN, found the API's on MSDN, and even some sample code on MSDN, as well as ridiculously clear and intuitive information on how it was all connected (hell, they even create logical diagrams for you). Within a couple hours I had it all done and my software was running as I wanted, much simpler than it was for XP.[/quote]

I wouldn't mind writing something like that.

But the big question is - who will pay $699 for entry version and $2599 for pro license with special options for 3-year SOHO plan at a discount of $9899.

FYI, documentation writers are typically paid some 10% more than software engineers. And herein lies the problem. Quality documentation doesn't just pop up. It's a lot of painstaking tedious work, requiring a lot of revisions, reviews and above all, proper training in writing. It's nothing new that open source or FOSS model cannot create good documentation without solid funding and a well organized process. There is literally a handful of projects that manage that.

[quote]MSDN has STL C++ documentation, and even entire sections around clever/neat short-hand notations and tricks. Things I never found so well centralized or organized on C++ focused websites like cprogramming.com or cplusplus.com. After having been developing with C++ for years I came across those sections in MSDN and learned quite a few new things and even had better clarity on many features I didn't have before then.[/quote]C++ is Microsoft's strategic interest.

[quote]Finally, clearly, Microsoft has a conflict of interest in supporting OpenGL, even though they do to a limited extent (documentation wise). But a major player that is as well as financed like Apple, that could really make this all happen, it must! >:][/quote]

Apple doesn't need OpenGL, nor does it want it. It's a dead end. For a simple reason - they cannot control it and Apple is killing everything it doesn't fully own and control.

The future and present is OpenGL/ES. The other direction is WebGL, which at this point it's a joke.

And there are two paths. Users will simply use an engine, something like Unity3D, never touching the graphics APIs. Graphics professionals already know the basics and a lot more, so it comes down to debugging drivers and devices, not piecing together API calls.

At this point, the low level APIs serve similar purpose as [url="http://www.ctyme.com/rbrown.htm"]Interrupt Lists[/url]. It was just a little over 10 years ago that I actually had to use those to draw stuff on screen.

Share this post


Link to post
Share on other sites
If you know the subject well enough, sure, go for it.
[b]It would also be nice if there were more people who contributed to the Wiki[/b] (http://www.opengl.org/wiki)
For a while, it was mostly me, but then Alfonse started adding. Zyx2000.
That is too few. It should be community driven which means there should be much more people in principle.

The problem I see with personal websites is that they repeat the weirdnesses and mistakes of others.
[b]At least the Wiki can have some peer review.[/b]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Announcements

  • Forum Statistics

    • Total Topics
      628308
    • Total Posts
      2981979
  • Similar Content

    • By mellinoe
      Hi all,
      First time poster here, although I've been reading posts here for quite a while. This place has been invaluable for learning graphics programming -- thanks for a great resource!
      Right now, I'm working on a graphics abstraction layer for .NET which supports D3D11, Vulkan, and OpenGL at the moment. I have implemented most of my planned features already, and things are working well. Some remaining features that I am planning are Compute Shaders, and some flavor of read-write shader resources. At the moment, my shaders can just get simple read-only access to a uniform (or constant) buffer, a texture, or a sampler. Unfortunately, I'm having a tough time grasping the distinctions between all of the different kinds of read-write resources that are available. In D3D alone, there seem to be 5 or 6 different kinds of resources with similar but different characteristics. On top of that, I get the impression that some of them are more or less "obsoleted" by the newer kinds, and don't have much of a place in modern code. There seem to be a few pivots:
      The data source/destination (buffer or texture) Read-write or read-only Structured or unstructured (?) Ordered vs unordered (?) These are just my observations based on a lot of MSDN and OpenGL doc reading. For my library, I'm not interested in exposing every possibility to the user -- just trying to find a good "middle-ground" that can be represented cleanly across API's which is good enough for common scenarios.
      Can anyone give a sort of "overview" of the different options, and perhaps compare/contrast the concepts between Direct3D, OpenGL, and Vulkan? I'd also be very interested in hearing how other folks have abstracted these concepts in their libraries.
    • By aejt
      I recently started getting into graphics programming (2nd try, first try was many years ago) and I'm working on a 3d rendering engine which I hope to be able to make a 3D game with sooner or later. I have plenty of C++ experience, but not a lot when it comes to graphics, and while it's definitely going much better this time, I'm having trouble figuring out how assets are usually handled by engines.
      I'm not having trouble with handling the GPU resources, but more so with how the resources should be defined and used in the system (materials, models, etc).
      This is my plan now, I've implemented most of it except for the XML parts and factories and those are the ones I'm not sure of at all:
      I have these classes:
      For GPU resources:
      Geometry: holds and manages everything needed to render a geometry: VAO, VBO, EBO. Texture: holds and manages a texture which is loaded into the GPU. Shader: holds and manages a shader which is loaded into the GPU. For assets relying on GPU resources:
      Material: holds a shader resource, multiple texture resources, as well as uniform settings. Mesh: holds a geometry and a material. Model: holds multiple meshes, possibly in a tree structure to more easily support skinning later on? For handling GPU resources:
      ResourceCache<T>: T can be any resource loaded into the GPU. It owns these resources and only hands out handles to them on request (currently string identifiers are used when requesting handles, but all resources are stored in a vector and each handle only contains resource's index in that vector) Resource<T>: The handles given out from ResourceCache. The handles are reference counted and to get the underlying resource you simply deference like with pointers (*handle).  
      And my plan is to define everything into these XML documents to abstract away files:
      Resources.xml for ref-counted GPU resources (geometry, shaders, textures) Resources are assigned names/ids and resource files, and possibly some attributes (what vertex attributes does this geometry have? what vertex attributes does this shader expect? what uniforms does this shader use? and so on) Are reference counted using ResourceCache<T> Assets.xml for assets using the GPU resources (materials, meshes, models) Assets are not reference counted, but they hold handles to ref-counted resources. References the resources defined in Resources.xml by names/ids. The XMLs are loaded into some structure in memory which is then used for loading the resources/assets using factory classes:
      Factory classes for resources:
      For example, a texture factory could contain the texture definitions from the XML containing data about textures in the game, as well as a cache containing all loaded textures. This means it has mappings from each name/id to a file and when asked to load a texture with a name/id, it can look up its path and use a "BinaryLoader" to either load the file and create the resource directly, or asynchronously load the file's data into a queue which then can be read from later to create the resources synchronously in the GL context. These factories only return handles.
      Factory classes for assets:
      Much like for resources, these classes contain the definitions for the assets they can load. For example, with the definition the MaterialFactory will know which shader, textures and possibly uniform a certain material has, and with the help of TextureFactory and ShaderFactory, it can retrieve handles to the resources it needs (Shader + Textures), setup itself from XML data (uniform values), and return a created instance of requested material. These factories return actual instances, not handles (but the instances contain handles).
       
       
      Is this a good or commonly used approach? Is this going to bite me in the ass later on? Are there other more preferable approaches? Is this outside of the scope of a 3d renderer and should be on the engine side? I'd love to receive and kind of advice or suggestions!
      Thanks!
    • By nedondev
      I 'm learning how to create game by using opengl with c/c++ coding, so here is my fist game. In video description also have game contain in Dropbox. May be I will make it better in future.
      Thanks.
    • By Abecederia
      So I've recently started learning some GLSL and now I'm toying with a POM shader. I'm trying to optimize it and notice that it starts having issues at high texture sizes, especially with self-shadowing.
      Now I know POM is expensive either way, but would pulling the heightmap out of the normalmap alpha channel and in it's own 8bit texture make doing all those dozens of texture fetches more cheap? Or is everything in the cache aligned to 32bit anyway? I haven't implemented texture compression yet, I think that would help? But regardless, should there be a performance boost from decoupling the heightmap? I could also keep it in a lower resolution than the normalmap if that would improve performance.
      Any help is much appreciated, please keep in mind I'm somewhat of a newbie. Thanks!
    • By test opty
      Hi,
      I'm trying to learn OpenGL through a website and have proceeded until this page of it. The output is a simple triangle. The problem is the complexity.
      I have read that page several times and tried to analyse the code but I haven't understood the code properly and completely yet. This is the code:
       
      #include <glad/glad.h> #include <GLFW/glfw3.h> #include <C:\Users\Abbasi\Desktop\std_lib_facilities_4.h> using namespace std; //****************************************************************************** void framebuffer_size_callback(GLFWwindow* window, int width, int height); void processInput(GLFWwindow *window); // settings const unsigned int SCR_WIDTH = 800; const unsigned int SCR_HEIGHT = 600; const char *vertexShaderSource = "#version 330 core\n" "layout (location = 0) in vec3 aPos;\n" "void main()\n" "{\n" " gl_Position = vec4(aPos.x, aPos.y, aPos.z, 1.0);\n" "}\0"; const char *fragmentShaderSource = "#version 330 core\n" "out vec4 FragColor;\n" "void main()\n" "{\n" " FragColor = vec4(1.0f, 0.5f, 0.2f, 1.0f);\n" "}\n\0"; //******************************* int main() { // glfw: initialize and configure // ------------------------------ glfwInit(); glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3); glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); // glfw window creation GLFWwindow* window = glfwCreateWindow(SCR_WIDTH, SCR_HEIGHT, "My First Triangle", nullptr, nullptr); if (window == nullptr) { cout << "Failed to create GLFW window" << endl; glfwTerminate(); return -1; } glfwMakeContextCurrent(window); glfwSetFramebufferSizeCallback(window, framebuffer_size_callback); // glad: load all OpenGL function pointers if (!gladLoadGLLoader((GLADloadproc)glfwGetProcAddress)) { cout << "Failed to initialize GLAD" << endl; return -1; } // build and compile our shader program // vertex shader int vertexShader = glCreateShader(GL_VERTEX_SHADER); glShaderSource(vertexShader, 1, &vertexShaderSource, nullptr); glCompileShader(vertexShader); // check for shader compile errors int success; char infoLog[512]; glGetShaderiv(vertexShader, GL_COMPILE_STATUS, &success); if (!success) { glGetShaderInfoLog(vertexShader, 512, nullptr, infoLog); cout << "ERROR::SHADER::VERTEX::COMPILATION_FAILED\n" << infoLog << endl; } // fragment shader int fragmentShader = glCreateShader(GL_FRAGMENT_SHADER); glShaderSource(fragmentShader, 1, &fragmentShaderSource, nullptr); glCompileShader(fragmentShader); // check for shader compile errors glGetShaderiv(fragmentShader, GL_COMPILE_STATUS, &success); if (!success) { glGetShaderInfoLog(fragmentShader, 512, nullptr, infoLog); cout << "ERROR::SHADER::FRAGMENT::COMPILATION_FAILED\n" << infoLog << endl; } // link shaders int shaderProgram = glCreateProgram(); glAttachShader(shaderProgram, vertexShader); glAttachShader(shaderProgram, fragmentShader); glLinkProgram(shaderProgram); // check for linking errors glGetProgramiv(shaderProgram, GL_LINK_STATUS, &success); if (!success) { glGetProgramInfoLog(shaderProgram, 512, nullptr, infoLog); cout << "ERROR::SHADER::PROGRAM::LINKING_FAILED\n" << infoLog << endl; } glDeleteShader(vertexShader); glDeleteShader(fragmentShader); // set up vertex data (and buffer(s)) and configure vertex attributes float vertices[] = { -0.5f, -0.5f, 0.0f, // left 0.5f, -0.5f, 0.0f, // right 0.0f, 0.5f, 0.0f // top }; unsigned int VBO, VAO; glGenVertexArrays(1, &VAO); glGenBuffers(1, &VBO); // bind the Vertex Array Object first, then bind and set vertex buffer(s), //and then configure vertex attributes(s). glBindVertexArray(VAO); glBindBuffer(GL_ARRAY_BUFFER, VBO); glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW); glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 3 * sizeof(float), (void*)0); glEnableVertexAttribArray(0); // note that this is allowed, the call to glVertexAttribPointer registered VBO // as the vertex attribute's bound vertex buffer object so afterwards we can safely unbind glBindBuffer(GL_ARRAY_BUFFER, 0); // You can unbind the VAO afterwards so other VAO calls won't accidentally // modify this VAO, but this rarely happens. Modifying other // VAOs requires a call to glBindVertexArray anyways so we generally don't unbind // VAOs (nor VBOs) when it's not directly necessary. glBindVertexArray(0); // uncomment this call to draw in wireframe polygons. //glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); // render loop while (!glfwWindowShouldClose(window)) { // input // ----- processInput(window); // render // ------ glClearColor(0.2f, 0.3f, 0.3f, 1.0f); glClear(GL_COLOR_BUFFER_BIT); // draw our first triangle glUseProgram(shaderProgram); glBindVertexArray(VAO); // seeing as we only have a single VAO there's no need to // bind it every time, but we'll do so to keep things a bit more organized glDrawArrays(GL_TRIANGLES, 0, 3); // glBindVertexArray(0); // no need to unbind it every time // glfw: swap buffers and poll IO events (keys pressed/released, mouse moved etc.) glfwSwapBuffers(window); glfwPollEvents(); } // optional: de-allocate all resources once they've outlived their purpose: glDeleteVertexArrays(1, &VAO); glDeleteBuffers(1, &VBO); // glfw: terminate, clearing all previously allocated GLFW resources. glfwTerminate(); return 0; } //************************************************** // process all input: query GLFW whether relevant keys are pressed/released // this frame and react accordingly void processInput(GLFWwindow *window) { if (glfwGetKey(window, GLFW_KEY_ESCAPE) == GLFW_PRESS) glfwSetWindowShouldClose(window, true); } //******************************************************************** // glfw: whenever the window size changed (by OS or user resize) this callback function executes void framebuffer_size_callback(GLFWwindow* window, int width, int height) { // make sure the viewport matches the new window dimensions; note that width and // height will be significantly larger than specified on retina displays. glViewport(0, 0, width, height); } As you see, about 200 lines of complicated code only for a simple triangle. 
      I don't know what parts are necessary for that output. And also, what the correct order of instructions for such an output or programs is, generally. That start point is too complex for a beginner of OpenGL like me and I don't know how to make the issue solved. What are your ideas please? What is the way to figure both the code and the whole program out correctly please?
      I wish I'd read a reference that would teach me OpenGL through a step-by-step method. 
  • Popular Now