Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix Git source URL in *.rockspec #8

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rocks/sdl2-scm-1.rockspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package = "sdl2"
version = "scm-1"

source = {
url = "git://github.com/torch/sdl2-ffi.git"
url = "git+https://github.com/arkenidar/lua-sdl2-ffi-luajit.git"
}

description = {
Expand Down
16 changes: 13 additions & 3 deletions test/video/test-bmp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ local windowsurface = sdl.getWindowSurface(window)

local image = sdl.loadBMP("lena.bmp")

sdl.upperBlit(image, nil, windowsurface, nil)
-- moved inside the loop
--- sdl.upperBlit(image, nil, windowsurface, nil)
--- sdl.updateWindowSurface(window)

sdl.updateWindowSurface(window)
sdl.freeSurface(image)
-- moved at the end
--- sdl.freeSurface(image)

local running = true
local event = ffi.new('SDL_Event')
Expand All @@ -28,7 +30,15 @@ while running do
running = false
end
end

-- added
sdl.upperBlit(image, nil, windowsurface, nil)
sdl.updateWindowSurface(window)

end

-- added
sdl.freeSurface(image)

sdl.destroyWindow(window)
sdl.quit()
41 changes: 41 additions & 0 deletions windows-cygwin-setup.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# install cygwin and ...
# - curl
# - wget
# - gcc-core
# - git
# - make
# - unzip
# ... in it (via setup.exe)

# install luajit (required below)
git clone https://luajit.org/git/luajit.git
cd ~/luajit && make && make install
ln -sf luajit-2.1.0-beta3 /usr/local/bin/luajit # version?
which luajit
cp ~/luajit/src/cyglua51.dll /usr/bin
luajit -v

cd ~ && ls

# install luarocks (required below)
cd ~/luarocks-3.9.1 && ls
./configure && make && make install
which luarocks
luarocks-admin
mkdir ~/.luarocks
luarocks config variables.LUALIB "libluajit-5.1.dll.a" # for luarocks config variables.LUA_LIBDIR
luarocks config variables.LUA_LIBDIR ~/luajit/src
luarocks-admin

cd ~ && ls

# requires: luarocks
# install luajit-ffi-sdl : "arkenidar/lua-sdl2-ffi-luajit"
luarocks install https://raw.githubusercontent.com/arkenidar/lua-sdl2-ffi-luajit/master/rocks/sdl2-scm-1.rockspec
# install SDL redistributable
cp ~/SDL2.dll /usr/bin/cygSDL2.dll # from website libsdl.org

# requires: luajit
# test video feature by showing an image
git clone https://github.com/arkenidar/lua-sdl2-ffi-luajit
cd ~/lua-sdl2-ffi-luajit/test/video/ && luajit test-bmp.lua # works!