Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I have all of the requirements but im still getting an error #4

Open
userdotexe opened this issue Nov 21, 2023 · 2 comments
Open

I have all of the requirements but im still getting an error #4

userdotexe opened this issue Nov 21, 2023 · 2 comments

Comments

@userdotexe
Copy link

I have all of the packages including opensimplex and they are all upgraded to or higher than the requirements i read in the requirements.txt file but i still get this error: ValueError: Requested OpenGL version 330, got version 310
Here is my code so far:
main.py:
from settings import *
import moderngl as mgl
import pygame as pg
import sys

class VoxelEngine:
def init(self):
pg.init()
pg.display.gl_set_attribute(pg.GL_CONTEXT_MAJOR_VERSION, 3)
pg.display.gl_set_attribute(pg.GL_CONTEXT_MAJOR_VERSION, 3)
pg.display.gl_set_attribute(pg.GL_CONTEXT_PROFILE_MASK, pg.GL_CONTEXT_PROFILE_CORE)
pg.display.gl_set_attribute(pg.GL_DEPTH_SIZE, 24)

    pg.display.set_mode(WIN_RES, flags=pg.OPENGL | pg.DOUBLEBUF)
    self.ctx = mgl.create_context()

    self.ctx.enable(flags=mgl.DEPTH_TEST | mgl.CULL_FACE | mgl.BLEND)
    self.ctx.gc_mode = 'auto'

    self.clock = pg.time.Clock()
    self.delta_time = 0
    self.time = 0

    self.is_running = True

def update(self):
    self.delta_time = self.clock.tick()
    self.time = pg.time.get_ticks() * 0.001
    pg.display.set_caption(f'{self.clock.get_fps() :.0f}')

def render(self):
    self.ctx.clear()
    pg.display.flip()

def handle_events(self):
    for event in pg.event.get():
        if event.type == pg.QUIT or (event.type == pg.KEYDOWN and event.key == pg.K_ESCAPE):
            self.is_running = False

def run(self):
    while self.is_running:
        self.handle_events()
        self.update()
        self.render()
    pg.quit()
    sys.exit()

if name == 'main':
app = VoxelEngine()
app.run()

settings:
from numba import njit
import numpy as np
import glm
import math

WIN_RES = glm.vec2(1600,900)

@userdotexe
Copy link
Author

btw- i googled this issue and it said that sometimes it has to do with the graphics on your computer so i switched to my desktop with a good graphics card and i still get this error

@JustAnEric
Copy link

JustAnEric commented Nov 26, 2023

Your OpenGL does not support version 3.3. Switch the shader files #version 330 core to #version 310 core or #version 310 es and change your Pygame OpenGL configuration to match appropriately in the main.py file (if you need to)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants