Search found 224 matches

by gothon
Nov 29, 2011 16:01
Forum: Windows
Topic: Tablet PC (Wacom) Pen Programming?
Replies: 43
Views: 9441

Thank you TJF for your suggestion however I have actually tried gdk/gtk already. As it turns out the extended device feilds don't seem to be declared in any version of the FB headers I have tried. I don't know why they aren't but information on this topic is scarce even on the internet. Sculpt.bas(1...
by gothon
Nov 28, 2011 18:57
Forum: Windows
Topic: Tablet PC (Wacom) Pen Programming?
Replies: 43
Views: 9441

I have completed a freebasic translastion of Wacom's TiltTest example program including the important wintab.h header file. http://www.vast3d.com/~athomson/exe/TiltTestFB.zip The origional C example program can be obtained from Wacom's windows develper page: http://www.wacomeng.com/windows/index.htm...
by gothon
Nov 09, 2011 2:24
Forum: Projects
Topic: Isometric Game
Replies: 8
Views: 4802

angros47, I do have a weird question for you! ok, so I have this world map, which is stored in a 3-dimensional array filled with pointers to terrain tiles (basically). Is it possible to take that same array, and transform it into a 3D terrain? For example, imagine an RTS game with an overhead/Iso v...
by gothon
Nov 08, 2011 23:48
Forum: General
Topic: Saving / save the RND state
Replies: 12
Views: 728

All of these custom random number generators and workarounds are nice, but you are all missing the obvious easy workaround: Function Rnd2() As Double Static RndState2 As Double RndState2 = rnd randomize RndState2 Return RndState2 End Function dim rndstate as double randomize 1 rndstate = rnd...
by gothon
Nov 02, 2011 3:52
Forum: Community Discussion
Topic: Can you do this in FB :)
Replies: 9
Views: 1193

Its actually not a bad recursive definition of addition, if you need to define it in terms of increments and decrements. The obvious thing is of course it makes for a really inefficient computer program, that is on a real processor. If you use a really simple language that doesn't support addition, ...
by gothon
Nov 01, 2011 22:13
Forum: Game Dev
Topic: Voxel game - is it hard to make?
Replies: 18
Views: 6043

Ok, I have some good simplified example code, I hope people will find useful. Type Vect3D Union V(2) As Single Type As Single X, Y, Z End Type End Union '... End Type Enum VoxSide Explicit Left = 1 Right = 2 Down = 4 Up = 8 Front = 16 Back = 32 End Enum Enum VoxType Vox_Air = 0 Vox_Dirt = 1 ...
by gothon
Nov 01, 2011 3:09
Forum: Game Dev
Topic: Voxel game - is it hard to make?
Replies: 18
Views: 6043

As it turns out, I am also making a 'Minecraft like' Block/voxel game in FreeBASIC at the moment. http://vast3d.com/~athomson/exe/VRTS/Wine16.png My current program generates a simple 1024x40x1024 map using a non random terrain generator, and renders 64x20x64 sections of that map using texture mappe...
by gothon
Oct 30, 2011 19:12
Forum: Community Discussion
Topic: Dennis Richie is dead
Replies: 8
Views: 1097

There is no prize for maths, either, which is a more interesting omission. Yes that omission is more interesting given that math was very established at the time. But you can still win a fields medal in math or the Abel prize. Interestingly the fields medal wasn't first awarded until 1936 (35 years...
by gothon
Sep 26, 2011 5:03
Forum: Community Discussion
Topic: Integrated vs. Euler Method-Approximated Distance
Replies: 5
Views: 526

The Runge-Kutta methods are good for simulations involving more general differential equations which often don't even have a closed form solution. In the case of constant acceleration, the integral is exact and should be fast enough for most applications. It can even be computed incrementally from f...
by gothon
Jul 26, 2011 1:10
Forum: General
Topic: signed vs. unsigned again...
Replies: 6
Views: 1086

Ok, so if you fix the lower bound so that the unsigned variable doesn't underflow, it will print out 10 through 1.

Code: Select all

dim x as uinteger

for x=10 to 1 step -1
? x
next x


But if you use any lower unsigned type it doesn't print anything??

Code: Select all

dim x as ushort

for x=10 to 1 step -1
? x
next x
by gothon
Jul 18, 2011 5:20
Forum: Hardware Interfaces / Communication
Topic: threads and winsock
Replies: 13
Views: 4028

From what I understand that is the way sockets are supposed to work. TCP needs a separate port number to distinguish each connection, so the socket interface automatically generates a new port number for each client that connects to a server. Otherwise, web servers wouldn't be able to handle multipl...
by gothon
Apr 14, 2011 20:30
Forum: Beginners
Topic: UDTs containing Dynamic Arrays
Replies: 4
Views: 1155

Ok, I ultimately decided to combine all our ideas together by effectively reimplementing dynamic arrays using a series of Macros that allocate memory using New[]. #Ifndef NULL #Define NULL 0 #EndIf #Define VA_UBOUND(ARRAY) ARRAY##_UBound #MACRO VARARRAY(ARRAY, VARTYPE) ARRAY As VARTY...
by gothon
Apr 13, 2011 2:06
Forum: Beginners
Topic: UDTs containing Dynamic Arrays
Replies: 4
Views: 1155

You can mimic the functionality of dynamic arrays using pointers... Yes obviously, however correctly using ALLOC functions is a messy business. I think it would be best if I could just make a pointer to a dynamic array, then all I would need to do is create it and destroy it in the constructor/dest...
by gothon
Apr 11, 2011 23:05
Forum: Beginners
Topic: UDTs containing Dynamic Arrays
Replies: 4
Views: 1155

UDTs containing Dynamic Arrays

Hi, I'm new to FB but I am familiar with other versions of BASIC and C. What I'm trying to do is convert a VB6 source file that I made to FB. Apparently FB supports dynamic arrays using the same syntax as VB6, and also supports user defined types using similar syntax. However, the FB compiler does n...

Go to advanced search