Questions tagged [glad]

GLAD is an open-source C/C++/D OpenGL function/extension loading library for C/C++/D generated by Python script from the Khronos API specification XML documents.

Resources:

131 questions
2
votes
1 answer

glClear() crashes GLFW when including GLAD

When I started I used the GLFW example code: #include int main(void) { GLFWwindow* window; /* Initialize the library */ if (!glfwInit()) return -1; /* Create a windowed mode window and its OpenGL context */ …
Regin.hd
  • 21
  • 2
2
votes
1 answer

What is the function/class member can I use in SFML 2.5.1 to load glad

How would I initialize glad in a SFML 2.5.1 app? Is there a function or class member to do that? I am following learnopengl's tutorials (but this time with SFML, instead of GLFW) Edit: To clarify, I mean that with glad and GLFW, you…
KapowCabbage
  • 65
  • 1
  • 8
2
votes
1 answer

Why should you use an external OpenGL loader function instead of GLAD's built in loader?

I've been using GLAD with SFML for some time and I've been using GLAD's built-in function loader, gladLoadGL which worked just fine for me. Now I'm looking at GLFW and it's saying both in their guide and on the Khronos opengl wiki that you should be…
kiroma
  • 101
  • 7
2
votes
1 answer

How to make visual studio code detect glad.h in visual studio code, ubuntu

I already tried altering the c_cpp_properties file to include the path where glad.h is installed, like this: { "configurations": [ { "name": "Linux", "includePath": [ "${workspaceFolder}/**", …
ayy_chemixd
  • 113
  • 10
2
votes
1 answer

KernelBase.dll exception code 0x0EEDFADE (but no crash) when Visual Studio is NOT run as administrator (GLFW/glad application)

I'm using Visual Studio 2019 and have the following simple OpenGL program as a minimal example (using GLFW and GLAD): #include #include #include void error_callback(int error, const char* description) { …
coder2k
  • 47
  • 2
  • 7
2
votes
2 answers

Access violation error when calling glGetString

I'm creating an OpenGL application in C++ using SDL2 + GLAD. In my main function, I have the following code: #include #include #include int main(int argc, char *argv[]) { if (SDL_Init(SDL_INIT_VIDEO) < 0) { …
Thomas
  • 1,123
  • 3
  • 13
  • 36
1
vote
0 answers

GLAD vs GLEW with GLFW

What is the difference between GLAD and GLEW and which one would be better for me to learn? GLAD appears to be more common. Is there a reason for that?
1
vote
0 answers

C++ project not building in linux but got built and ran on windows

I have a workspace inside which there are two projects "Physx2D" and "SandBox". First one is built to a shared library and second into a console app. SandBox requires the Physx2D library and is set as start project. I am using glfw3 library and glad…
Seon Il
  • 43
  • 8
1
vote
1 answer

How to init glad without the glfw loader (using windows headers)

I'm trying to render to a HWND window using a HGLRC OpenGL rendering context. I have to initiate the glad but gladLoadGLLoader((GLADloadproc)wglGetProcAddress)) and the gladLoadGL() seems to be failing. glad OpenGL version : 4.0 core I've been…
LucasSokol
  • 125
  • 4
1
vote
1 answer

Glad function description / documentation

I am learning how to build and run OpenGL with C. And i am using Glad as a function loader. Keeping it simple, i am compiling and linking manually. Everything works. (Using Visual Studio Code as an IDE) It is helpful to show what a function does.…
Dahl
  • 149
  • 1
  • 10
1
vote
0 answers

Hexadecimal value of core-profile OpenGL macros

I'm working on a C++ graphics library using OpenGL. I'm on Windows, which only supports OpenGL 1.1, and I therefore have to manually load the functions from the 4.6 version. My first thought was to use GLAD, which I've used before and does all the…
user21907176
1
vote
1 answer

How to read the VAO from the GLSL shader, or pass an Array of indefinite size to the shader?

I partially managed to implement rendering by individual indexes - by loading the indexes into VAO, setting their layout, and passing them using glDrawArrays but now another problem - for test i created arrays in shader itself - ` #version 330…
1
vote
1 answer

GLSL unexpected step behaviour

I have an outline shader I adapted from Here, although I only can implement section 1 (depth) because I don't have a normal buffer (which I don't really know what that is). It works pretty good, although with faraway objects they fade out at certain…
Gaming Gecko
  • 49
  • 1
  • 7
1
vote
1 answer

Photo generated by glReadPixels is broken

I am trying to save OpenGL screen to file using glReadPixels. I found this code: void saveScreenshotToFile(const char* filename, int WIDTH, int HEIGHT) { int* buffer = new int[WIDTH * HEIGHT * 3]; glReadPixels(0, 0, WIDTH, HEIGHT, GL_BGR,…
1
vote
1 answer

add_subdirectory not working with custom source macro

I'm pretty new to CMake, and have just gotten into setting it up. I've gone ahead and implemented a simple opengl boilerplate, whose tree is like this CMakeLists.txt include glad KHR src glad glad.c …
Moosa
  • 63
  • 5
1
2
3
8 9