Comments (11)
Ok, the latest release has fixed the issue. Happy hacking!!
from moderngl-window.
This is probably just a lingering glError
that happened during initialization. Consume that error with pyopengl or self.ctx.error
in your __init__
.
I should probably ensure in the window itself there are no errors lingering.
EDIT: Never mind. I'm already doing this
moderngl-window/moderngl_window/context/base/window.py
Lines 138 to 140 in 3b503d2
from moderngl-window.
Are you running it with run_window_config(Config)
?
Also, does one of the examples even work for you in the examples
directory?
from moderngl-window.
This works for me. It does indeed look like a glerror was lingering from somewhere..
import moderngl_window
from OpenGL.GL import *
class BasicWindowConfig(moderngl_window.WindowConfig):
"""Minimal WindowConfig example"""
gl_version = (3, 3)
title = "Basic Window Config"
def __init__(self, **kwargs):
super().__init__(**kwargs)
# Consume lingering glerror from somewhere
self.ctx.error
def render(self, time, frametime):
glClearColor(1.0, 0.0, 0.0, 0.0)
glClear(GL_COLOR_BUFFER_BIT)
if __name__ == '__main__':
moderngl_window.run_window_config(BasicWindowConfig)
from moderngl-window.
Yep. It's a lingering glError from querying the context info. Everything should work if you just consume the glerror. Meanwhile I'll fix this bug.
The err = 1280
you are getting is just a GL_INVALID_ENUM
lingering from earlier. If you did not have a context you would see a completely different error.
from moderngl-window.
Released a new version: 2.0.2 that should fix this.
Upgrade with pip install -U moderngl-window
Also added a basic pyopengl example: https://github.com/moderngl/moderngl-window/blob/master/examples/with_pyopengl.py
Please let me know if this resolves your issue.
from moderngl-window.
Are you running it with
run_window_config(Config)
?
Also, does one of the examples even work for you in theexamples
directory?
I am running it with run_window_config(Config)
, I have added that.
Some of the examples do work, but others haven't been tested.
from moderngl-window.
Upgrade to moderngl-window 2.0.2 and I'm 99% sure your issues will be resolved!
from moderngl-window.
This works for me. It does indeed look like a glerror was lingering from somewhere..
import moderngl_window from OpenGL.GL import * class BasicWindowConfig(moderngl_window.WindowConfig): """Minimal WindowConfig example""" gl_version = (3, 3) title = "Basic Window Config" def __init__(self, **kwargs): super().__init__(**kwargs) # Consume lingering glerror from somewhere self.ctx.error def render(self, time, frametime): glClearColor(1.0, 0.0, 0.0, 0.0) glClear(GL_COLOR_BUFFER_BIT) if __name__ == '__main__': moderngl_window.run_window_config(BasicWindowConfig)
After I add self.ctx.error
at the top __init__
function, everything goes pretty fine. Many thanks to you!
from moderngl-window.
I'm cloning this project because my mirror doesn't contain the latest version.
from moderngl-window.
ah ok. git pull
then 😄
Good luck with your projects @Remering and do not hesitate to open new issues if you stumble over something weird.
from moderngl-window.
Related Issues (20)
- Just set window image HOT 3
- wishes for mglw.geometry module HOT 1
- run_window_config_instance
- Modifying node matrix doesn't change rendered model HOT 4
- allow to manage pygame2 USEREVENT HOT 3
- Pygame2 error: 'Event' object has no attribute 'state' HOT 5
- Examples have been flipped and have inverted color channels HOT 7
- why is resolution twice the window_size ? HOT 2
- Pypi source distribution not published for 2.4.2 HOT 2
- Add Support for Animations HOT 1
- load_scene has incorrect mesh name HOT 1
- Key press event not registered HOT 6
- Deprecate Pyrr in favour of PyGLM HOT 2
- PIL versions <10.0.1 vulnerability HOT 2
- Resizing window from within WindowConfig after initialization HOT 2
- Window resize is laggy and doesn't resize viewport HOT 1
- x is flipped for everything (scene and etc) HOT 2
- How to customize context creation? HOT 2
- integration imgui image, rendering to background vs imgui window is flipped HOT 2
- detecting left shift and left ctrl alone HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from moderngl-window.