Search found 6 matches

by Zefz
Mon Sep 19, 2011 3:18 pm
Forum: Coding Questions
Topic: linked list as parameter to thread
Replies: 11
Views: 2682

Re: linked list as parameter to thread

Shouldnt something simple like this work?

Code: Select all

Procedure MyFunction(List Parameter)
  ProcedureReturn ListSize( Parameter() )
EndProcedure

NewList MyList()
CreateThread( @MyFunction(), @MyList() )
by Zefz
Mon May 09, 2011 8:04 pm
Forum: Game Programming
Topic: Network Question
Replies: 9
Views: 3347

Re: Network Question

Yes that is what I thought. But does each RecieveNetworkData only contain data from a specific SendNetworkData? Or is it possible that it also contains some bytes from a whole different SendNetworkData that has nothing to do with this batch of data? (if so, that would be strange, since TCP is ...
by Zefz
Mon May 09, 2011 5:59 pm
Forum: Game Programming
Topic: Network Question
Replies: 9
Views: 3347

Network Question

Neither the manual or the code samples are really clear on this. Let's say this is my server loop:

Repeat

Protected Event.w = NetworkServerEvent()
If Event

ClientID.q = EventClient()

Select Event

;Someone new has connected to us
Case #PB_NetworkEvent_Connect
SendNetworkMessage ...
by Zefz
Sat May 07, 2011 2:40 pm
Forum: Coding Questions
Topic: Freeing arrays at procedure exit?
Replies: 5
Views: 1260

Re: Freeing arrays at procedure exit?

A related question. Take a look at this code:


Structure MyStruct
*MemoryAddress
VarA.w
VarB.w
EndStructure

Global Dim MyArray.MyStruct(10)

For i = 0 To 10
MyArray(i)\MemoryAddress = AllocateMemory(2048)
Next

FreeArray( MyArray() )


Is there a memory leak now because I did not FreeMemory ...
by Zefz
Thu Mar 31, 2011 1:24 am
Forum: Linux
Topic: Reading mouse not working?
Replies: 6
Views: 1878

Re: Reading mouse not working?

Ah yes true... the code above seems to work perfectly on Windows, but on Linux the window does not properly stretch to fullscreen (it stays 640x480 pixels in the middle of the screen while the rest around is simply white).

Autostretch problem on Linux?
by Zefz
Wed Mar 30, 2011 11:44 pm
Forum: Linux
Topic: Reading mouse not working?
Replies: 6
Views: 1878

Re: Reading mouse not working?

Thanks, that did the trick :)

Here is the code for anyone who is interested:

;Open video Screen
If win_mode
screenID = OpenWindow(0, 0, 0, 640, 480, "Lost Labyrinth", #PB_Window_Maximize|#PB_Window_ScreenCentered|#PB_Screen_SmartSynchronization|#PB_Window_BorderLess)
screenopen = 1
Else ...