Search found 44 matches

by mcbiff
Feb 04, 2011 5:51
Forum: General
Topic: longint problem
Replies: 4
Views: 1389

I'm aware of that. The problem is this:

Code: Select all

dim as longint x
dim as integer i = 63
x = 2^i - 1
print x
x = 2^63 - 1
print x

Code: Select all

9223372036854775807
-9223372036854775808
This is surely buggy behaviour?
by mcbiff
Feb 04, 2011 4:42
Forum: General
Topic: longint problem
Replies: 4
Views: 1389

longint problem

Code: Select all

dim as longint x = 2^63 - 1
print x
x = 2^64
print x

Code: Select all

-9223372036854775808
-9223372036854775808
What's going on here? It seems the highest positive number I can get is 2^63 - 513.
by mcbiff
Jun 07, 2010 18:12
Forum: Windows
Topic: Trouble getting focus - XP
Replies: 3
Views: 1407

I've got it working by changing HKCU\Control Panel\Desktop\ForegroundLockTimeout to 0, as suggested in an old thread. You have to reboot for it to take effect - which is why I didn't think it worked.
by mcbiff
Jun 07, 2010 17:56
Forum: Windows
Topic: Trouble getting focus - XP
Replies: 3
Views: 1407

Trouble getting focus - XP

This program is supposed to get focus when F9 is pressed. However, all that happens is the title bar flashes. I've tried setfocus, setactivewindow, etc with no success. Does anybody know what's wrong? #include "fbgfx.bi" #include "windows.bi" #define keydown(kcode) iif((getasynck...
by mcbiff
May 02, 2010 0:06
Forum: General
Topic: draw string doesn't work with GFX_SHAPED_WINDOW
Replies: 4
Views: 1278

Yeah, that works. Thanks.
by mcbiff
May 01, 2010 20:46
Forum: General
Topic: draw string doesn't work with GFX_SHAPED_WINDOW
Replies: 4
Views: 1278

It would appear that #include "fbgfx.bi" using FB screenres 640, 480, 32,, GFX_SHAPED_WINDOW draw string (10, 10), "test" sleep doesn't work, but #include "fbgfx.bi" using FB screenres 640, 480, 32,, GFX_SHAPED_WINDOW pset (0,0), 0 draw string (10, 10), "test"...
by mcbiff
May 01, 2010 20:34
Forum: General
Topic: draw string doesn't work with GFX_SHAPED_WINDOW
Replies: 4
Views: 1278

draw string doesn't work with GFX_SHAPED_WINDOW

Can anyone confirm this?
by mcbiff
Mar 29, 2010 2:27
Forum: General
Topic: function pointers
Replies: 2
Views: 941

I thought I tried that - thanks!
by mcbiff
Mar 29, 2010 2:13
Forum: General
Topic: function pointers
Replies: 2
Views: 941

function pointers

I'm playing around with function pointers, working from the example at http://www.freebasic.net/wiki/wikka.php?wakka=KeyPgOpProcptr . This doesn't work, instead printing some address: declare function hello as integer dim fptr as function as integer fptr = procptr(hello) print fptr sleep function he...
by mcbiff
Feb 17, 2010 1:04
Forum: Libraries Questions
Topic: extended library/freetype - colours [solved]
Replies: 1
Views: 1439

this did the trick: function colourblender ( byval source_pixel as uinteger, byval destination_pixel as uinteger, byval parameter as any ptr ) as uinteger dim as uinteger colour = *cptr(uinteger ptr, parameter) return colour and ((source_pixel shr 8 and &hFF0000) +_ 'shift alpha into RGB channel...
by mcbiff
Feb 17, 2010 0:40
Forum: Libraries Questions
Topic: extended library/freetype - colours [solved]
Replies: 1
Views: 1439

extended library/freetype - colours [solved]

In the freebasic extended library you can use ttf fonts like this: gfx.font.loadttf("VeraMono.ttf", font, 32, 128, 13) draw string (1, 50), "Test 12345",, font, alpha However, if I want to print in multiple colours it seems I have to load a font for each colour. There must be ano...
by mcbiff
Aug 09, 2009 21:11
Forum: General
Topic: Quicker way?
Replies: 4
Views: 1323

Thanks JL35. That's a bit neater than stylin's suggestion.
by mcbiff
Aug 09, 2009 20:43
Forum: General
Topic: Quicker way?
Replies: 4
Views: 1323

Thanks for that stylin. The endianness isn't an issue.
by mcbiff
Aug 09, 2009 19:53
Forum: General
Topic: Quicker way?
Replies: 4
Views: 1323

Quicker way?

Is there a quicker/nicer way of converting a 4-character string into an integer, like this:

Code: Select all

dim s as string = chr(1) + chr(2) + chr(3) + chr(4)
dim i as uinteger = 16777216 * s[0] + 65536 * s[1] + 256 * s[2] + s[3] 
by mcbiff
Aug 05, 2009 0:38
Forum: Libraries & Headers
Topic: FreeBASIC Extended Library Release 0.2.2
Replies: 127
Views: 66295

Any plans for gif support?