All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
Here we write upgrading notes for brands. It's a team effort to make them as
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
Here we write upgrading notes for brands. It's a team effort to make them as
| #define STB_IMAGE_STATIC | |
| #define STB_IMAGE_IMPLEMENTATION | |
| #include "stb_image.h" // get from https://raw.githubusercontent.com/nothings/stb/master/stb_image.h | |
| #include <windows.h> | |
| int main(int argc, char* argv[]) | |
| { | |
| int w, h; | |
| stbi_uc* data = stbi_load(argv[1], &w, &h, NULL, 4); |
| // Sample code showing how to create a modern OpenGL window and rendering context on Win32. | |
| #include <windows.h> | |
| #include <gl/gl.h> | |
| #include <stdbool.h> | |
| typedef HGLRC WINAPI wglCreateContextAttribsARB_type(HDC hdc, HGLRC hShareContext, | |
| const int *attribList); | |
| wglCreateContextAttribsARB_type *wglCreateContextAttribsARB; |
| // example how to set up OpenGL core context on Windows | |
| // and use basic functionality of OpenGL 4.5 version | |
| // important extension functionality used here: | |
| // (4.3) KHR_debug: https://www.khronos.org/registry/OpenGL/extensions/KHR/KHR_debug.txt | |
| // (4.5) ARB_direct_state_access: https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_direct_state_access.txt | |
| // (4.1) ARB_separate_shader_objects: https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_separate_shader_objects.txt | |
| // (4.2) ARB_shading_language_420pack: https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_shading_language_420pack.txt | |
| // (4.3) ARB_explicit_uniform_location: https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_explicit_uniform_location.txt |
| #define WIN32_LEAN_AND_MEAN | |
| #include <winsock2.h> | |
| #include <windows.h> | |
| #define SECURITY_WIN32 | |
| #include <security.h> | |
| #include <schannel.h> | |
| #include <shlwapi.h> | |
| #include <assert.h> | |
| #include <stdio.h> |
| // clang.exe -Os -fno-unwind-tables -nostdlib -fuse-ld=lld -Wl,-fixed,-merge:.rdata=.text,-subsystem:console FlushFileCache.c -o FlushFileCache.exe | |
| #define WIN32_LEAN_AND_MEAN | |
| #include <windows.h> | |
| #pragma comment (lib, "kernel32.lib") | |
| #pragma comment (lib, "advapi32.lib") | |
| #define error(str) do { DWORD written; WriteFile(GetStdHandle(STD_ERROR_HANDLE), str, sizeof(str)-1, &written, NULL); } while (0) |
| // example how to set up OpenGL core context on Windows for rendering to multiple windows | |
| #define WINDOW_COUNT 4 // how many windows we'll be opening? | |
| // important extension functionality used here: | |
| // (4.3) KHR_debug: https://www.khronos.org/registry/OpenGL/extensions/KHR/KHR_debug.txt | |
| // (4.5) ARB_direct_state_access: https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_direct_state_access.txt | |
| // (4.1) ARB_separate_shader_objects: https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_separate_shader_objects.txt | |
| // (4.2) ARB_shading_language_420pack: https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_shading_language_420pack.txt | |
| // (4.3) ARB_explicit_uniform_location: https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_explicit_uniform_location.txt |
| // http://marina.sys.wakayama-u.ac.jp/~tokoi/?date=20110221 | |
| inline void billboard() | |
| { | |
| GLfloat m[16]; | |
| glGetFloatv(GL_MODELVIEW_MATRIX, m); | |
| float inv_len; | |
| m[8] = -m[12]; |
| /* | |
| CREATING THE VAO & VBO | |
| ====================== | |
| Objects must be generated via its corresponding glGen...() function | |
| To perform any operations on any of OpenGL's objects, we must bind | |
| the objects by invoking it corresponding glBind...() function | |
| For @param GLenum target: | |
| GL_ARRAY_BUFFER for Vertex attributes (Non-indexing method) | |
| GL_ELEMENT_ARRAY_BUFFER for Vertex array indices (Indexing method) |