SFML Wrapper Fullscreen Bug?

new topic     » topic index » view thread      » older message » newer message

Hello,

While using Greg's FFI library I am currently working on wrapping CSFML 2.5.2/2.6. When I went to make an example program, the window appeared as a full-screen, even though I set the video mode to 800x600,32. I'm not sure if this is a bug with SFML or the Euphoria side of things.

https://github.com/SFML/CSFML - C binding of SFML using the most recent build as of today

https://katfile.com/61tfpd1p1808/SFML2.6.zip.html - Current source code and DLLs (in case for testing/debugging purposes) - Still working on the audio side of the wrapper

public constant sfVideoMode = define_c_struct({ 
	C_UINT, --width 
	C_UINT, --height 
	C_UINT --bitsPerPixel 
}) 
 
public enum type sfWindowStyle 
	sfNone = 0, 
	sfTitlebar = 1, 
	sfResize = 2, 
	sfClose = 8, 
	sfDefaultStyle = 11 -- sfTitlebar | sfResize | sfClose 
end type 
 
public enum type sfContextAttribute 
	sfContextDefault = 0, 
	sfContextCore = 1, 
	sfContextDebug = 4 
end type 
 
public constant sfContextSettings = define_c_struct({ 
	C_UINT, --depthBits 
	C_UINT, --stencilBits 
	C_UINT, --antialiaslevel 
	C_UINT, --majorVersion 
	C_UINT, --minorVersion 
	C_UINT32, --attributeFlags 
	C_BOOL --sRgbCapable 
}) 
 
public constant xsfRenderWindow_create = define_c_func(gfx,"+sfRenderWindow_create",{sfVideoMode,C_STRING,C_UINT32,C_POINTER},C_POINTER) 
 
public function sfRenderWindow_create(sequence mode,sequence title,sfWindowStyle style,atom settings) 
	return c_func(xsfRenderWindow_create,{mode,title,style,settings}) 
end function 
include std/ffi.e 
include std/math.e 
 
include sfml_system.e 
include sfml_window.e 
include sfml_graphics.e 
 
sequence mode = {800,600,32} 
 
atom win = sfRenderWindow_create(mode,"Window",sfClose,NULL) 
 
if win = -1 then 
	puts(1,"Failed to create window!\n") 
	abort(0) 
end if 
 
atom evt = allocate_struct(sfEvent) 
atom evt_type = 0 
 
while sfRenderWindow_isOpen(win) do 
 
	while sfRenderWindow_pollEvent(win,evt) do 
			evt_type = peek_type(evt,C_UINT32) 
			if evt_type = sfEvtClosed then 
				sfRenderWindow_close(win) 
			end if 
	end while 
	 
	sfRenderWindow_clear(win,sfBlue) 
	 
	sfRenderWindow_display(win) 
end while 
 
sfRenderWindow_destroy(win) 
 
new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu