140 questions
0
votes
1
answer
136
views
C++ / GLFW / ImGui crash in DLL: Assertion bd->PrevWndProc != nullptr
I’m working on a custom C++ engine using GLFW and GLAD with OpenGL. My engine is compiled as a DLL and used in an editor/game executable. So far, everything works fine: I can create a window and ...
1
vote
2
answers
174
views
GLAD initialization on multiple dlls that use GLAD
At the moment I am making a simple 3D space using glfw and glad. My approach for project management is to separate it into smaller projects, like:
Core
Renderer
Scene
Window
ExternalGraphicsLibs
...
1
vote
1
answer
342
views
Linker Error When Linking GLAD with OpenGL and GLFW in CMake/MSBuild
I'm working on an OpenGL project using GLFW and GLAD in a CMake-based setup:
cmake_minimum_required(VERSION 3.16) # Specify the project name and the languages
project(MyApp LANGUAGES CXX)
# Set C++ ...
2
votes
1
answer
488
views
Trying to load OpenGL 4.1 but only get OpenGL 2.1 on MacOS
I am trying to setup a OpenGL-based project in my Macbook Pro 14 (M2 Pro CPU, Macos Sonoma 14.5). I have basically managed to get everything working, BUT no matter what I do I cannot make the program ...
-2
votes
1
answer
53
views
. Quad disappears once i moved it into a seperate class [duplicate]
I finally got a quad working with textures, and to clean up my code, I decided to move it into a separate class, but now it disappeared without any error message.
Main file:
#include <glad/glad.h&...
1
vote
1
answer
143
views
How to fix "Access violation executing location" when using GLFW and GLAD
I caught this exception when running the program:
Exception thrown at 0x0000000000000000 in OpenGL project.exe: 0xC0000005: Access violation executing location 0x0000000000000000.
This is my code ...
0
votes
1
answer
345
views
OpenGL Glad, glDeleteVertexArrays(), glGetError() causes segfault
In the destructor of a renderer class, I want to delete the buffers/vertex array object associated with the shape. I save both (VAO/VBO) as member variables after initialization. Tracked down the ...
0
votes
0
answers
1k
views
"DT_TEXTREL in a PIE" when linking?
When trying to set up my environment, I got GLFW set up, and was able to compile the example blank window provided in the page (LINK), and also the rotating triangle one (LINK) which also requires ...
0
votes
0
answers
639
views
How can I fix LNK2019 with CMake and GLAD? [duplicate]
I am trying to make a project that utilises OpenGL via GLAD and GLFW, however I am stuck at a problem which is every time I try to build and run my application, it fails with
LNK2019: unresolved ...
0
votes
2
answers
116
views
EXC_BAD_ACCESS from glClear(GL_COLOR_BUFFER_BIT)?
I've looked around and apparently I've got the choice between this solution, and my problem was the same as the following:
text,
but I still don't know how to solve this problem.
When I use glClear(...
1
vote
0
answers
142
views
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 ...
0
votes
0
answers
840
views
"undefined reference" for GLFW + GLAD using vcpkg
I'm attempting to start an OpenGL/C++ project using GLFW3 and GLAD and with vcpkg as package manager. I use vcpkg in manifest mode. The project compiles fine, as long as I only use GLFW3, so I have ...
1
vote
0
answers
92
views
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 ...
1
vote
1
answer
191
views
OpenGL 4.6 batch rendering draws nothing
I tried to rework the code from this tutorial to handle batch rendering.
But only a dark background is displayed. Highlights of my program:
#include "batch_2D.hpp"
#include "...
0
votes
2
answers
84
views
glReadPixels() read wrong value
currently, I am trying to read back the data I transfer to texture in OpenGL. However, I do not receive the correct result. Where do I wrong?
#include <glad/glad.h>
#include <GLFW/glfw3.h>
...
0
votes
1
answer
352
views
Segmentation Fault on OpenGL application with GLAD and GLFW3 (openGL 4.1/pureC/MacOS)
I'm trying to learn OpenGL and C by following the learnopengl.com tutorial and the JDAH series of videos about OpenGL in C. I especially got really inspired by this project of him : minecraft in one ...
0
votes
1
answer
606
views
Why is linking to opengl32.dll required?
In order to use modern OpenGL functions above legacy version 1.1, a loading library is required (unless you manually load the function pointers from the GPU drivers yourself of course). If opengl32....
-2
votes
1
answer
67
views
Makefiles giving the compiler files that dont/shouldnt exist
I have a basic Makefile setup for C OpenGL programming but when running there are 2 files passed to clang that shouldnt exist and i have no idea why. The problem happened after i added glad and glfw ...
-1
votes
1
answer
919
views
Problems getting OpenGL to work in VSCode on Mac
I am trying to complie a basic openGL program in VSCode on mac. I am using glad and GLFW, and I have the Glad files in the same folder as the test.cpp file I am trying to run. However, the include ...
0
votes
1
answer
662
views
Why is there a blank white screen rendering?
I am trying implement GLAD-GLFW-IMGUI version of renderer. I am just trying to display two Imgui windows with docking system. I am using docking branch of Imgui, GLAD(core) and glfw. Below is my code ...
1
vote
1
answer
2k
views
How to include Libraries without an IDE
I just downloaded the MingW Compiler and the glfw and glad libraries. i set up Notepad++ to compile with mingW and now i cant figure out how to include the above mentiond libraries. do i have to put ...
1
vote
1
answer
160
views
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 ...
-1
votes
1
answer
313
views
GLSL shader not writing to color_attatchment1
I am trying to render to multiple render targets, I set up a float texture and bound it to COLOR_ATTACHMENT1. This all works well and the buffer is created and bound properly. The buffer is even drawn ...
0
votes
1
answer
477
views
I really need to add # in Cmake url but BYPRODUCTS containing a "#" is not allowed
Code in CMakeLists.txt
if (NOT glad_FOUND)
include(FetchContent)
FetchContent_Declare(
glad
URL "https://glad.dav1d.de/#language=c&specification=gl&api=gl%...
2
votes
1
answer
1k
views
glClear() crashes GLFW when including GLAD
When I started I used the GLFW example code:
#include <GLFW/glfw3.h>
int main(void)
{
GLFWwindow* window;
/* Initialize the library */
if (!glfwInit())
return -1;
/* ...