C++ general note: C++ is C with extra features added Mostly This means C programs are also C++ programs Library authors sometimes avoid using C++ features That way the library works with either one OpenGL, Vulkan, and many others do this GLM will be an exception Displaying with the Video Card, general procedure for OpenGL 4.0+ or Vulkan Load whatever you want to display in main memory Format should be xyzxyzxyz, or xyzwxyzwxyzw, or something like that Move the list of vertices into video memory Same thing for colors, if you want those rgbargbargba, or rgbrgbrgb, or something like that Load a vertex shader It's a program that says what to do with the vertices (transformations, etc) Can also assign color to a vertex Load a fragment shader It's a program that figures out what color each fragment should be fragment = pixel Input will include which vertices were used to determine this fragment Can also include a color, determined by what the vertex shader output Start the main loop, which will: Prepare the transformation matrix or matrices for the next scene, if anything is moving Clear the framebuffer Draw a new frame How would Vulkan be different? Nothing in the above is wrong for vulkan But each step will require more detail OpenGL makes a lot of assumptions about what you want They'll be basically correct for what we're doing If they weren't, then we'd be in for a hard time of it Lab 2: Something with OpenGL Depends where we end up after Tuesday C/C++ note: We're *probably* going to hit stuff that wasn't emphasized in CS211 Stop me when we do Sometimes it's easier to learn something when you need it anyway Simple demo that you can run: glad vs. glew Both set up OpenGL functions we'll use later Both also include the function prototypes for GL functions glfw3 handles our windows and OS interaction This makes it so Linux and Windows versions are really similar Once we reach the main loop: glm library uses operator overloading for matrix math C++ and objects and this: Reminder: An object encapsulates properties and methods We can trigger methods by calling them OR using operators They can be triggered other ways too (constructor, destructor, etc)