diff options
| author | jussi | 2023-10-30 00:04:11 +0200 |
|---|---|---|
| committer | jussi | 2023-10-30 00:04:11 +0200 |
| commit | d287078c658d26d41a28f92b62b023048c5503ce (patch) | |
| tree | fb045110fde9329782d21324cc7a9092128a1126 /examples/snake/main.lua | |
| parent | 992310fb90832ddf493ec33f1099dbbf3e0987f3 (diff) | |
| download | reilua-enhanced-d287078c658d26d41a28f92b62b023048c5503ce.tar.gz reilua-enhanced-d287078c658d26d41a28f92b62b023048c5503ce.tar.bz2 reilua-enhanced-d287078c658d26d41a28f92b62b023048c5503ce.zip | |
Userdata objects can be referenced with lightuserdata.
Diffstat (limited to 'examples/snake/main.lua')
| -rw-r--r-- | examples/snake/main.lua | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/examples/snake/main.lua b/examples/snake/main.lua index 2465d1e..e90c732 100644 --- a/examples/snake/main.lua +++ b/examples/snake/main.lua @@ -6,7 +6,6 @@ local STATE = { TITLE = 0, GAME = 1, OVER = 2 } -- Enum wannabe. -- Resources local framebuffer = nil -local framebufferTex = nil local monitor = 0 local monitorPos = RL.GetMonitorPosition( monitor ) local monitorSize = RL.GetMonitorSize( monitor ) @@ -74,7 +73,6 @@ function RL.init() RL.SetWindowIcon( RL.LoadImage( RL.GetBasePath().."../resources/images/apple.png" ) ) framebuffer = RL.LoadRenderTexture( RESOLUTION ) - framebufferTex = RL.GetRenderTextureTexture( framebuffer ) grassTexture = RL.LoadTexture( RL.GetBasePath().."../resources/images/grass.png" ) snakeTexture = RL.LoadTexture( RL.GetBasePath().."../resources/images/snake.png" ) appleTexture = RL.LoadTexture( RL.GetBasePath().."../resources/images/apple.png" ) @@ -220,5 +218,5 @@ function RL.draw() RL.EndTextureMode() -- Draw framebuffer to window. - RL.DrawTexturePro( framebufferTex, { 0, 0, RESOLUTION[1], -RESOLUTION[2] }, { 0, 0, winSize[1], winSize[2] }, { 0, 0 }, 0.0, RL.WHITE ) + RL.DrawTexturePro( RL.GetRenderTextureTexture( framebuffer ), { 0, 0, RESOLUTION[1], -RESOLUTION[2] }, { 0, 0, winSize[1], winSize[2] }, { 0, 0 }, 0.0, RL.WHITE ) end |
