Category : opengl

I’m using glTexImage2D() to create a texture. The texture is from a simple array of pixels. I’m specifying pixels with the format RGBA. However, OpenGL seems to expect the pixels to be formatted ABGR (RGBA backwards) in calls to glTexImage2D(). The short of it is: GLuint CreateTexture() { int w = 16, h = 16; ..

Read more

I am using the Camera class from https://learnopengl.com/Getting-started/Camera. You can find the code here: https://learnopengl.com/code_viewer_gh.php?code=includes/learnopengl/camera.h I want to make the camera look in the negative direction of the y axis (from above). However simply changing the default pitch to -90 and the constraint values for it accordingly does not do the trick. It changed the ..

Read more

I study uniform blocks in opengl and for practice I write a circle with blurred edges. But when using memcpy, it gives a warning that an exception has not been handled: GLuint blockIndex = glGetUniformBlockIndex(programHandle, "BlobSettings"); // Allocate space for the buffer GLint blockSize; glGetActiveUniformBlockiv(programHandle, blockIndex, GL_UNIFORM_BLOCK_DATA_SIZE, &blockSize); GLbyte* blockBuffer; blockBuffer = (GLbyte*)malloc(blockSize); // Query ..

Read more