Skip to content

Commit 68c0e0e

Browse files
authored
Merge pull request #31 from Contraz/samplers
Remove remaining PyOpenGL + major cleanup + samplers
2 parents 4f8191a + 8fd289d commit 68c0e0e

File tree

142 files changed

+220658
-1028
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+220658
-1028
lines changed

.pylintrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ disable=print-statement,
136136
comprehension-escape,
137137
missing-docstring,
138138
duplicate-code,
139-
no-member
139+
no-member,
140+
C0326
140141

141142

142143
# Enable the message, report, category or checker with the given id(s). You can

README.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,11 @@ Features
4949
--------
5050

5151
* A simple effect system based on python packages
52-
* Supports loading GLTF and obj files/scenes
52+
* Supports loading GLTF 2.0 and obj files/scenes
5353
* Support for the rocket sync-tracker system to create interesting keyframe data (Using [pyrocket](https://github.com/Contraz/pyrocket))
5454
* Management commands to create new projects and effects
5555
* Convenient wrappers for VAO, Shader, Texture, FBO etc
56-
* On-the-fly Shader and VAO negotiation of the needed buffer binding
5756
* Runtime re-loading shaders (press R)
58-
* Strict validation in most OpenGL operations with reasonable error feedback
5957
* Time line / Timer support
6058
* A highly pluggable framework
6159
* Support for custom management commands
@@ -91,11 +89,10 @@ Running tests:
9189
pytest
9290
```
9391

94-
Bulding docs:
92+
Building docs:
9593

9694
```bash
97-
cd docs
98-
make html
95+
python setup.py build_sphinx
9996
```
10097

10198
Contributors

TODO.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
- Framebuffer Blitting
2626
- Textures:
2727
- 3D
28-
- Texture Array
2928
- Texture Cube
3029
- FBOs
3130
- Support layers

demosys/conf/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ def __repr__(self):
5959
settings_module=self.SETTINGS_MODULE,
6060
)
6161

62-
def add_shader_dir(self, dir):
62+
def add_shader_dir(self, directory):
6363
"""Hack in shader directory"""
6464
dirs = list(self.SHADER_DIRS)
65-
dirs.append(dir)
65+
dirs.append(directory)
6666
self.SHADER_DIRS = dirs
6767

6868
def add_texture_dir(self, directory):

demosys/conf/default_settings.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@
3030

3131
# OpenGL context configuration
3232
# version: (MAJOR, MINOR)
33-
# profile: any, core, compat
34-
# forward_compat: Whether we should drop fixed pipeline and only support core
3533
OPENGL = {
3634
"version": (3, 3),
3735
}

demosys/conf/settingsfile.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def create(settings):
1717
value = ",\n".join(' "{}": {}'.format(k, to_s(v)) for k, v in value.items())
1818

1919
# Add comma after the last dict entry
20-
if len(value) > 0:
20+
if value:
2121
value += ','
2222

2323
data += "%s = {\n%s\n}\n\n" % (name, value)
@@ -26,7 +26,7 @@ def create(settings):
2626
value = ",\n".join(" {}".format(to_s(v)) for v in value)
2727

2828
# Add comma after the last tuple entry
29-
if len(value) > 0:
29+
if value:
3030
value += ","
3131

3232
data += "{} = (\n{}\n)\n\n".format(name, value)
@@ -38,8 +38,8 @@ def create(settings):
3838
return data[:-1]
3939

4040

41-
def to_s(t):
42-
if isinstance(t, str):
43-
return '"{}"'.format(t)
41+
def to_s(var):
42+
if isinstance(var, str):
43+
return '"{}"'.format(var)
4444
else:
45-
return str(t)
45+
return str(var)

demosys/context/__init__.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,16 @@
66

77
def window() -> 'demosys.context.base.Window':
88
"""The window instance we are rendering to"""
9+
if not WINDOW:
10+
raise RuntimeError("Attempting to get window before creation")
11+
912
return WINDOW
1013

1114

1215
def ctx() -> moderngl.Context:
1316
"""ModernGL context"""
14-
return WINDOW.ctx
17+
win = window()
18+
if not win.ctx:
19+
raise RuntimeError("Attempting to get context before creation")
20+
21+
return win.ctx

demosys/core/finders.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ def find_cached(self, path):
5959
:return: The absolute path to the file or None
6060
"""
6161
entry = self._cache.get(path)
62-
6362
if entry.exists:
6463
return entry.abspath
6564

demosys/core/management/commands/run.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ def handle(self, *args, **options):
1919
print(manager_path)
2020
try:
2121
manager_cls = import_string(manager_path)
22-
except ImportError as e:
23-
raise ImproperlyConfigured("EFFECT_MANAGER '{}' failed to initialize: {}".format(manager_path, e))
22+
except ImportError as err:
23+
raise ImproperlyConfigured(
24+
"EFFECT_MANAGER '{}' failed to initialize: {}".format(manager_path, err))
2425

2526
manager = manager_cls()
2627
demosys.run(manager=manager)

demosys/deferred/effect.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@
33

44

55
class DeferredEffect(Effect):
6-
pass
6+
7+
def draw(self, time, frametime, target):
8+
pass

0 commit comments

Comments
 (0)