Skip to content

Commit 8770b7d

Browse files
committed
Update example template in README
1 parent 87097f2 commit 8770b7d

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

README.rst

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,13 @@ effect.py
113113
114114
class CubeEffect(effect.Effect):
115115
"""Rotating cube with UVs and normals"""
116-
def init(self):
116+
def __init__(self):
117117
self.shader = self.get_shader('cube/cube.glsl')
118118
self.texture = self.get_texture('cube/texture.png')
119119
self.cube = geometry.cube(2.0, 2.0, 2.0)
120120
121121
@effect.bind_target
122-
def draw(self, time, target):
122+
def draw(self, time, frametime, target):
123123
GL.glEnable(GL.GL_DEPTH_TEST)
124124
125125
# Cheater methods in base class for lazyness
@@ -184,12 +184,10 @@ Some babble about the current state of the project:
184184
with only positions.
185185
- We only support 2D textures at the moment loaded with PIL/Pillow, but
186186
this is trivial to extend.
187-
- Resource loading is supported in the ``Effect`` class itself. In ``init()``
187+
- Resource loading is supported in the ``Effect`` class itself. In ``__init__()``
188188
you can fetch resources using for example ``self.get_shader`` or\ ``self.get_texture``.
189189
This will return a lazy object that will be populated after the loading
190190
stage is done.
191-
- Please do not implement ``__init__()`` as this is used to initialize
192-
internal attributes in the effect class. Stick to ``init()`` for now.
193191
- Resources shared between effects can be put outside effect packages
194192
inside your project directory. For example in ``testproject/resources/shaders``
195193
and ``testproject/resources/textures``. Make sure you add those paths in the

0 commit comments

Comments
 (0)