access violation with only GL_COLOR_BUFFER_BIT

0

Unhandled exception in 0x7B372F75 (ig9icd32.dll) in forespend.exe: 0xC0000005: access violation writing to location 0x07E00000. i have tried to run glClear(GL_COLOR_BUFFER_BIT); but it returned me this error, my program kept running and working, but seems that it wont work properly due to this error. the glClear is working with other tags inside of it like ´GL_DEPTH_BUFFER_BIT´ and others. in debug no problem shows up, the error just appear in the middle of the code like this:

error

If exist an alternative to GL_COLOR_BUFFER_BIT id like to know.

the code:

#include<GL/glfw3.h>
#include<map>
#include<iostream>
#include<stdio.h>
#include<chrono>
#include<stdlib.h>
#define WIDTH 320
#define HEIGHT 200

struct key {

};

GLFWwindow* window;
GLFWmonitor* monitor;
bool running = 1, windowed;
std::map<int, key> keyMap;


void update(){}



void input(){}



void draw(){
    glClearColor(0.0, 0.0, 0.0, 1.0);
    glClear(GL_COLOR_BUFFER_BIT);
}

int main() {
    glfwWindowHint(GLFW_SAMPLES, 1);
    glfwWindowHint(GLFW_RESIZABLE, GL_FALSE);
    if (!glfwInit()) fprintf(stderr, "opengl error\n");
    window = glfwCreateWindow(WIDTH, HEIGHT, "end", NULL, NULL);
    if (window == NULL) {std::cout << "window error\n" << std::endl; glfwTerminate();}
    glfwMakeContextCurrent(window);
    monitor = glfwGetPrimaryMonitor();

    while (running)
    {
        update();
        input();
        draw();
    }


    glfwDestroyWindow(window);
    glfwTerminate();


}

c++
opengl
glfw
asked on Stack Overflow Apr 19, 2021 by JK Tech • edited Apr 20, 2021 by Spektre

1 Answer

0

well... i looked for any solution, talked to intel support and it just resulted in they saying i need to get the driver with my notebook provider (samsung) since the installed windows is the one installed in fabric, i have tried to update the drivers with samsung update and it installed an older driver. the error kept happening, since i was starting this week with opengl and was getting this problem since the beginning now i decided to move to another renderer, that is vulkan. it works fine now, so if youre new in opengl and get this problem, i think vulkan is a great option to overcome this since it runs faster and have a great compatibility with windows,ios, linux and android and if the code is for older machines or you really need opengl, so i must say that youd need a virtual machine for this unhappily. in my case i cant use VM because this notebook is low spec

answered on Stack Overflow Apr 21, 2021 by JK Tech

User contributions licensed under CC BY-SA 3.0