Thanks for testing guys. I should have tested in 64-bit first. I posted new updates to the gist.
Intent was to provide a demo that just runs; you shouldn't have to modify the source to get it running. Looks like I need to address that first.
@dodicat,
- The 64-bit is jumpy here too, even in full screen mode.
- I am planning to add selection of different timing modes, if OK with you, I was planning to add your pendulum code, I like it. I want to be able to select between a few different screen drawing demos.
For me, smoothest action on win7 so far is, 32-bit exe, fullscreen, any size, any depth, using page flipping.
ENUM and PROPERTY as LONG/INTEGER- I see, ENUM has sizeof(integer), and can't assign ENUM type to PROPERTY of LONG type.
- I don't think that's a bug, though should probably investigate more if that is more related to ENUM or PROPERTY.
Default Screen Mode:- I thought 1024x768x16 would be a safe choice for default mode. I guess not.
- I changed how the default mode is selected...
- default mode is automatically selected to be largest screen mode that is also smaller than desktop.
- I am trusting that gfxlib2's ScreenList() provides good results, if it's not, then we have other problems.
- Also, I changed the dim shared modelist*() arrays to an one object that should choose a working default SCREENRES mode every time
SLEEP at end of a program:- I don't agree with adding SLEEP to every program - this program is supposed to be a console program (no -s gui)
- HOWEVER, I am guessing you are running from IDE or Explorer, so I added some #ifdef __FB_WIN32__ specific code:
A) if run from Explorer or an IDE (that doesn't capture console output), program should SLEEP and wait for key press.
B) if run from Cmd, program should just end
- Basically it checks if the program created the console, or the parent process created the console
Code: Select all
#ifdef __FB_WIN32__
#include once "windows.bi"
'' if not running from command line, add SLEEP statment
sub MaybeSleep()
dim as HWND consoleWnd = GetConsoleWindow()
dim as DWORD dwProcessId
GetWindowThreadProcessId(consoleWnd, @dwProcessId)
if( GetCurrentProcessId() = dwProcessId ) then
locate 1, 1
hColor 15, 0
print "PRESS ANY KEY TO EXIT ... "
sleep
end if
end sub
#else
#define MaybeSleep()
#endif
Recoding of SCREEN_MODE_SIZE:@MrSwiss,
- I didn't know that FIELD=1 makes no difference. I want to ensure the structure is packed, so it seems like a good idea to specify it.
- ScreenList() returns LONG, however, H & W are DWORD on windows and __u32 on linux (i.e. USHORT) at the API, so, it's messy...
- I see your point about little vs big endian. Maybe should be using HIWORD/LOWORD instead of a structure.
Code: Select all
union SCREEN_MODE_SIZE
mode as long
type field = 1
#ifdef __FB_BIGENDIAN__
w as ushort '' width - hiword
h as ushort '' height - loword
#else
h as ushort '' height - loword
w as ushort '' width - hiword
#endif
end type
end union
type SCREEN_MODE extends SCREEN_MODE_SIZE
d as long '' depth
end type
I can't address all issues today; or make all the changes I want to today. I will keep posting.
Thanks again for the responses.
@dodicat, I like the demo with 2 pendulums (pendula?). Yeah, it can be confusing, because with a monitor refresh rate, 60hz for me, I will see a new image every 16.67ms. But the "fps" simulated can be slower or faster than this. The comparison, ON ONE SCREEN, really helps. Cool.