Skip to content

Commit

Permalink
add dummy mode of framebuffer in emulator for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
chrox committed May 15, 2014
1 parent 32e1fdc commit e94fe28
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions ffi/framebuffer_SDL1_2.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ local BB = require("ffi/blitbuffer")
local fb = {}

function fb.open()
SDL.open()
if not fb.dummy then
SDL.open()
end

-- we present this buffer to the outside
fb.bb = BB.new(SDL.screen.w, SDL.screen.h)
Expand Down Expand Up @@ -52,7 +54,7 @@ function fb:refresh(refreshtype, waveform_mode, x1, y1, w, h)

-- adapt to possible rotation changes
self.real_bb:setRotation(self.bb:getRotation())

if SDL.SDL.SDL_LockSurface(SDL.screen) < 0 then
error("Locking screen surface")
end
Expand Down
4 changes: 3 additions & 1 deletion ffi/framebuffer_SDL2_0.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ local BB = require("ffi/blitbuffer")
local fb = {}

function fb.open()
SDL.open()
if not fb.dummy then
SDL.open()
end

-- we present this buffer to the outside
fb.bb = BB.new(SDL.w, SDL.h, BB.TYPE_BBRGB32)
Expand Down

0 comments on commit e94fe28

Please sign in to comment.