Skip to content

Replace batch.add with ShaderProgram#28

Draft
TinselTowns wants to merge 1 commit into
legorovers:masterfrom
TinselTowns:shader_program
Draft

Replace batch.add with ShaderProgram#28
TinselTowns wants to merge 1 commit into
legorovers:masterfrom
TinselTowns:shader_program

Conversation

@TinselTowns

Copy link
Copy Markdown

Due to changes in Pyglet 2.x Graphics Module, instead of using batch.add(), ShaderProgram must be written and used in ShaderProgram.vertex_list(). The ShaderProgram is written in the beginning of led.py, which I use to create a ShaderProgram. Similarly, batch.add() is used in other scripts like simulator.py. So, we could make a txt file with ShaderProgram, because writing it more than once is not efficient,
or we could define a global ShaderProgram variable to use it every time we did batch.add().

Due to changes in Pyglet 2.x Graphics Module, instead of using batch.add(),
ShaderProgram must be written and used in ShaderProgram.vertex_list().
The ShaderProgram is written in the beginning of led.py, which I use to create a ShaderProgram.
Similarly, batch.add() is used in other scripts like simulator.py.
So, we could make a txt file with ShaderProgram, because writing it more than once is not efficient,
 or we could define a global ShaderProgram variable to use it every time we did batch.add().
@louiseadennis

Copy link
Copy Markdown
Member

This looks good to me so far! I can run the pi2go and set the LEDs to light up. But if ShaderProgram is used in several places then creating as some kind of python module and importing it would be useful.

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

Successfully merging this pull request may close these issues.

2 participants