Search found 1357 matches

by badidea
Nov 25, 2010 15:10
Forum: General
Topic: UDT Comparison, confused [solved]
Replies: 5
Views: 969

Thanks, I know the 'quick fix', but I like the operator statement. Haven't used that before.

@edit:
Is there a 'memory compare' function that just compares all the bits in the 2 UDTs?
by badidea
Nov 25, 2010 0:50
Forum: General
Topic: UDT Comparison, confused [solved]
Replies: 5
Views: 969

UDT Comparison, confused [solved]

Why is "pos1 = pos2" allowed, but "if (pos1 = pos2) then" not?

Code: Select all

type position
  x as integer
  y as integer
end type

dim as position pos1, pos2

pos1 = pos2

if (pos1 = pos2) then
  beep
end if
by badidea
Nov 21, 2010 16:52
Forum: General
Topic: Converting a Keyboard application to Touch screen
Replies: 13
Views: 1179

Some code I just made, so not perfect. Just to give you some ideas. type screen_key as integer x, y as integer xs, ys as string label end type dim as screen_key screenKey(255) screenKey(asc("a")).x = 50 screenKey(asc("a")).y = 50 screenKey&...
by badidea
Nov 21, 2010 1:10
Forum: General
Topic: More threading
Replies: 17
Views: 4116

Thanks, I have the basics working. Using fd_set and 2-way communications, multiple clients. Works with WinXp and Ubuntu. Client.bas #include "network.bi" #include "fbgfx.bi" #DEFINE SERVER_PORT 27015 #DEFINE SERVER_IP "127.0.0.1" '--- CLIENT --- dim as SOCKET socketId d...
by badidea
Nov 18, 2010 0:55
Forum: General
Topic: More threading
Replies: 17
Views: 4116

I haven't had much time to work on this subject, but I did made some simple UDP messaging. Uses the standard FB libraries, still only 1-way, and still blocking calls. For windows, uncomment the statements with WSAsomething. Sender: #If Defined(__FB_WIN32__) #Include Once "win/winsock2.b...
by badidea
Nov 17, 2010 10:31
Forum: Beginners
Topic: [solved]branch crossing local definition error
Replies: 5
Views: 592

You know there is a statement called "for...next"?
It might make the code more clear.
by badidea
Nov 10, 2010 23:46
Forum: General
Topic: More threading
Replies: 17
Views: 4116

@pestery: I never knew that the FB libraries included socket functions. I'm am going to try that instead of fbnet. In fbnet I only see the select() function in the windows header file, not in the linux version. And I want my program to work with both. And since latency is important for the game, I'l...
by badidea
Nov 10, 2010 16:02
Forum: Projects
Topic: QuickFix for FBIDE
Replies: 13
Views: 3208

Good news.
Had to redo code in the past because of this bug.
by badidea
Nov 09, 2010 23:36
Forum: General
Topic: RGB picker
Replies: 7
Views: 669

Geany, which I use as Freebasic IDE under linux, has an color chooser that looks like this:
http://www.flickr.com/photos/30401670@N02/3328605368
by badidea
Nov 06, 2010 17:04
Forum: General
Topic: Questions About Running Total
Replies: 16
Views: 1205

Hi, I think you need 2 score variables for each player, e.g.: - runningScoreA - fixedScoreA If you decide not to roll the dice, fix new score: - fixedScoreA = runningScoreA If you roll "snake eyes", reset score to fixed one: - runningScoreA = fixedScoreA Question, why do you use pointers? dim a as i...
by badidea
Nov 06, 2010 16:04
Forum: General
Topic: More threading
Replies: 17
Views: 4116

And I was hoping that this would be easy. Anyway, how about SDLNet_UDP_Recv? "This is a non-blocking call, meaning if there’s no data ready to be received the function will return." See also: http://www.freebasic.net/forum/viewtopic.php?t=3268 ' check if there is a packet waiting sizerecv = SDLNet_U...
by badidea
Nov 06, 2010 13:26
Forum: General
Topic: More threading
Replies: 17
Views: 4116

Thanks, this will keep me busy for a while.
It will be a RTS-game.
by badidea
Nov 06, 2010 1:36
Forum: General
Topic: More threading
Replies: 17
Views: 4116

More threading

Hello all, I am trying to put network communication into a game. Which is new stuff for me. The plan is to have 1 sever and multiple clients. Now the function NetRead (fbnet from D.J.Peters, but probably any implementation) waits for incoming data. But in the game loop I don't want to spend time on ...
by badidea
Nov 05, 2010 14:39
Forum: Windows
Topic: Enumaration of Windows audio mixers.
Replies: 8
Views: 987

OK, new output: Mixer(0).Product Realtek HD Audio output version 5.10 Mixer(0).nLines 1 Mixer(0).Lines(0).Name Master Volume Mixer(0).Lines(0).Component speakers out Mixer(0).Lines(0).nControls 2 Mixer(0).Lines(0).Contro...
by badidea
Nov 05, 2010 12:40
Forum: Windows
Topic: Enumaration of Windows audio mixers.
Replies: 8
Views: 987

Mixer(0) Realtek HD Audio output version 5.10 Mixer(0).nLines 1 Mixer(0).Lines(0).Name Master Volume Mixer(0).Lines(0).nControls 2 Mixer(0).Lines(0).Controls(0).Name Master Volume Mixer(0).Lines(0).Controls(...

Go to advanced search