Skip to content

Commit c9e0f4e

Browse files
committed
Added some information about GLES.
1 parent a71aff9 commit c9e0f4e

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,29 @@ within the demo itself.)
1010
In order to play them, you have to have Löve installed. Then simply
1111
download the ``.love``-file and open it with Löve.
1212

13+
## A word on GLES
14+
If you want to play around with code that uses shaders, etc.
15+
and use it on mobile, make sure to test it with GLES like
16+
so:
17+
```shell
18+
$ LOVE_GRAPHICS_USE_OPENGLES=1 love game-dir
19+
```
20+
21+
To make sure, that you're graphics card actually does use GLES,
22+
here is an example, that **should fail** (complaining
23+
about initializing x in line 1) if GLES is used and
24+
should run fine otherwise:
25+
```lua
26+
function love.load()
27+
shader = love.graphics.newShader([[
28+
extern number x = 1.0;
29+
vec4 effect(vec4 color, Image tex, vec2 tc, vec2 sc){
30+
vec4 pixel = Texel(tex, tc);
31+
return pixel;
32+
]])
33+
end
34+
```
35+
1336
## Thunderstorm
1437
![Thunderstorm screenshot](thunderstorm/screenshot.gif "Thunderstorm screenshot")
1538

0 commit comments

Comments
 (0)