Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Gary

Pages: 1 2 [3] 4 5
31
Is there any way of forcing GLB to finish writing an ini file before it quits? I have noticed that on occasions when I quit a program that just happens to be writing to the ini file while quitting it corrupts it and is then recreated when the program is loaded next time zeroing everything stored

32
Is there any way (GLBasic or an inline C routine) of forcing the focus back to the running GLBasic program?

I am running in full screen and I call a shell command at start up which loads and closes correctly but at this point focus is not handed back to the GLBasic program (I have the AUTOPAUSE turned off so it does still run and displays on the screen but keyboard inputs are not accepted until the screen is touched)

Thanks
Gary

33
GLBasic - en / SHELLCMD question
« on: 2011-May-17 »
Apologies in advance for taking this a little off topic further on.

I have a program that uses the serial port for comms with another board and have found that unless I initialise the comms port with another program first GLB does not seem to be opening it up correctly (Im using Gernots Serial wrapper). So I have constructed a small program in VB that just opens the port.

Code: GLBasic [Select]
Module Module1

    Sub Main()
        SendSerialData("hello")
    End Sub
    Sub SendSerialData(ByVal data As String)
        ' Send strings to a serial port.
        Try
            Using com1 As IO.Ports.SerialPort =
                My.Computer.Ports.OpenSerialPort("COM1")
                com1.WriteLine(data)
            End Using
        Catch e As System.IO.IOException
            Console.WriteLine("port not open", e)
        End Try
    End Sub

End Module

which opens the port if it is present or gives a port not open message in the console if it is not present.

My problem is when I call the command with SHELLCMD using the following code

Code: GLBasic [Select]
        GLOBAL commsflag,rv

        commsflag = SHELLCMD("opencom4.exe",TRUE,TRUE,rv)

        DEBUG commsflag+"\n"
        DEBUG rv+"\n"

commsflag is always set to 1 indicating the program exited ok (I presume) and rv is always 0. Are there any VB gurus who could tell me how to get the console program to return a value indicating the status of the port that rv can then read? Or is there a way I can get GLB to detect there has been text in the opened console window and use that as an indication of the error?

I have already worked out another way round the problem but its messy and involves cycling the serial ports, sending data and looking for a response. If I cant get a quick fix to the above I will use this method

Thanks
Gary

34
Bug Reports / threads on IOS
« on: 2011-May-16 »
Using the current beta is there an issue running threads on IOS?

I tried to compile my project using threads and got a codesign error in xcode, rewrote the code that is in the thread to be part of the updatescreen routine and it works and compiles fine and runs on my iPhone

35
GLBasic - en / Debug error on Missing file
« on: 2011-May-15 »
Would it be possible to have the debugger automatically give a message when a filename is not found if debug mode is turned on?

36
FAQ / if/endif while/wend loops
« on: 2011-May-11 »
Would there be any chance of the IDE showing some sort of link to what IF/WHILE each ENDIF/WEND relates back to?

I know by doing proper indentation you should be able to spot any errors but when you have a few nested loops it can get messy.

Im thinking something along the lines of a dotted line being drawn on the IDE background that connects the 2 commands much like ultra edit does. Nothing complex just a quick visual indication

37
not sure if I am the only one who does this but thought I would make the suggestion in case others do it as well

When I open GLBasic and get the Project Wizard screen up I find myself double clicking on the recent project in the list I want to open and sitting for a few seconds waiting for it to open up (i.e. I dont click the OK to open it). Does anyone else make this mistake? and if so would it be possible to add double clicking on a project to open it as well as click then OK?

 

38
GLBasic - en / iphone compile error
« on: 2011-Apr-29 »
any ideas why I get this error when I try to compile in xcode?
Code: GLBasic [Select]
CodeSign /Users/gary_leeds/Library/Developer/Xcode/DerivedData/iPhone-bqozunwsxwuvboatwsmtogxnzdqr/Build/Products/Debug-iphoneos/iPhone.app
    cd /Users/gary_leeds/Desktop/XCode
    setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    setenv _CODESIGN_ALLOCATE_ /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate
    /usr/bin/codesign -f -s "iPhone Developer: Gary Pearson (GJ7V7PTEA2)" --resource-rules=/Users/gary_leeds/Library/Developer/Xcode/DerivedData/iPhone-bqozunwsxwuvboatwsmtogxnzdqr/Build/Products/Debug-iphoneos/iPhone.app/ResourceRules.plist --entitlements /Users/gary_leeds/Library/Developer/Xcode/DerivedData/iPhone-bqozunwsxwuvboatwsmtogxnzdqr/Build/Intermediates/iPhone.build/Debug-iphoneos/iPhone.build/iPhone.xcent /Users/gary_leeds/Library/Developer/Xcode/DerivedData/iPhone-bqozunwsxwuvboatwsmtogxnzdqr/Build/Products/Debug-iphoneos/iPhone.app

/Users/gary_leeds/Library/Developer/Xcode/DerivedData/iPhone-bqozunwsxwuvboatwsmtogxnzdqr/Build/Products/Debug-iphoneos/iPhone.app: object file format invalid or unsuitable
Command /usr/bin/codesign failed with exit code 1

thanks
Gary

39
GLBasic - en / Rotate and zoom a sprite
« on: 2011-Apr-25 »
Is there a simple way to take a 1024x768 sprite, rotate it by 90 degrees and resize to 320 x 480 (or 640 x 960)?

rotozoomsprite will only let you resize as a percentage of the original and the aspect is not the same for both x and y.

Is the only way to do it is to draw the rotated sprite to a back buffer screen, take that sprite and use zoomsprite to resize it down to the correct size?

thanks
Gary

40
Off Topic / Screen shot copyright question
« on: 2011-Apr-23 »
If I was to take screen shots from commercial PC games and use them in an iPhone app could I get done for copyright theft? My idea would not be ripping off the actual game concept of the original but just using the screenies in a quiz type format

Cheers
Gary

41
I know this is a very specific problem but not sure if it happens on other touch screens or if anyone can help

I am using a 3M Microtouch Touch screen for a project and if SYSTEMPOINTER is TRUE then it works totally fine on either windowed or full screen, the pointer follows my finger and the x,y debug output I have is spot on. If I turn the SYSTEMPOINTER to FALSE then the returned x,y values are all over the place. I can start in the bottom right of a 1024x768 screen and move my finger no more than 3mm towards the top left and the x,y is reported as 0,0. Infact most of the time the x is either 0 or 1024 and y is 0 or 768. It never reports the correct value. Yet if I move the mouse around the x,y shows correctly in my debug with the pointer off.

Any suggestions?

Thanks
Gary

42
I have a fair amount of data in my projects stored in arrays and wondered if there was an easier way to dump and read an array to an INI file than doing the following

Code: GLBasic [Select]
        INIPUT "pots","0,0,0",pots[0][0][0]
        INIPUT "pots","0,0,1",pots[0][0][1]
        INIPUT "pots","0,0,2",pots[0][0][2]
        INIPUT "pots","0,0,3",pots[0][0][3]
        INIPUT "pots","0,0,4",pots[0][0][4]
        INIPUT "pots","0,0,5",pots[0][0][5]
        INIPUT "pots","0,0,6",pots[0][0][6]
        INIPUT "pots","0,1,0",pots[0][1][0]
        INIPUT "pots","0,1,1",pots[0][1][1]
        INIPUT "pots","0,1,2",pots[0][1][2]
        INIPUT "pots","0,1,3",pots[0][1][3]
        INIPUT "pots","0,1,4",pots[0][1][4]
        INIPUT "pots","0,1,5",pots[0][1][5]
        INIPUT "pots","0,1,6",pots[0][1][6]
        INIPUT "pots","0,2,0",pots[0][2][0]
        INIPUT "pots","0,2,1",pots[0][2][1]
        INIPUT "pots","0,2,2",pots[0][2][2]
        INIPUT "pots","0,2,3",pots[0][2][3]
        INIPUT "pots","0,2,4",pots[0][2][4]
        INIPUT "pots","0,2,5",pots[0][2][5]
        INIPUT "pots","0,2,6",pots[0][2][6]
        INIPUT "pots","0,3,0",pots[0][3][0]
        INIPUT "pots","0,3,1",pots[0][3][1]
        INIPUT "pots","0,3,2",pots[0][3][2]
        INIPUT "pots","0,3,3",pots[0][3][3]
        INIPUT "pots","0,3,4",pots[0][3][4]
        INIPUT "pots","0,3,5",pots[0][3][5]
        INIPUT "pots","0,3,6",pots[0][3][6]


        INIPUT "pots","1,0,0",pots[1][0][0]
        INIPUT "pots","1,0,1",pots[1][0][1]
        INIPUT "pots","1,0,2",pots[1][0][2]
        INIPUT "pots","1,0,3",pots[1][0][3]
        INIPUT "pots","1,0,4",pots[1][0][4]
        INIPUT "pots","1,0,5",pots[1][0][5]
        INIPUT "pots","1,0,6",pots[1][0][6]
        INIPUT "pots","1,1,0",pots[1][1][0]
        INIPUT "pots","1,1,1",pots[1][1][1]
        INIPUT "pots","1,1,2",pots[1][1][2]
        INIPUT "pots","1,1,3",pots[1][1][3]
        INIPUT "pots","1,1,4",pots[1][1][4]
        INIPUT "pots","1,1,5",pots[1][1][5]
        INIPUT "pots","1,1,6",pots[1][1][6]
        INIPUT "pots","1,2,0",pots[1][2][0]
        INIPUT "pots","1,2,1",pots[1][2][1]
        INIPUT "pots","1,2,2",pots[1][2][2]
        INIPUT "pots","1,2,3",pots[1][2][3]
        INIPUT "pots","1,2,4",pots[1][2][4]
        INIPUT "pots","1,2,5",pots[1][2][5]
        INIPUT "pots","1,2,6",pots[1][2][6]
        INIPUT "pots","1,3,0",pots[1][3][0]
        INIPUT "pots","1,3,1",pots[1][3][1]
        INIPUT "pots","1,3,2",pots[1][3][2]
        INIPUT "pots","1,3,3",pots[1][3][3]
        INIPUT "pots","1,3,4",pots[1][3][4]
        INIPUT "pots","1,3,5",pots[1][3][5]
        INIPUT "pots","1,3,6",pots[1][3][6]

and a lot more arrays after this as well :(
 


I tried setting up a couple of nested loops and generating the variable names from that but it doesnt seem to like it

Any ideas?

Thanks
Gary

43
GLBasic - en / Dual screen support
« on: 2011-Mar-23 »
Is it possible for GLBasic to support two 1024x768 monitors mounted vertically with the primary screen on the bottom in full screen mode and display a screen of 1024x1536?

44
GLBasic - en / GP2X problem
« on: 2011-Mar-14 »
Just for a laugh I thought I would get a project im working on running on the GP2X (well actually I wanted to work on a device smaller than the 1024x768 screen I am using on the PC to make sure that my on screen buttons worked fine on a smaller res screen)

I have one routine that displays the graphics and have altered that to draw to a backscreen sprite and then switch to the main screen, resize the sprite from 1024 x 768 to 320 x 240 and output that single sprite.

If I run the program on the PC I get a nice small version of the larger screen that works perfectly.

When I compile and load it to the GP2X (after setting it to full screen and no pointer) I find that most of the graphics have not been scaled but some of them have and I end up with a totally unuseable screen.

If there a problem with STRETCHSPRITE or multiple screens on the GP2X?

Thanks
Gary

45
GLBasic - en / Correct use of GLOBAL?
« on: 2011-Mar-14 »
I like to try to keep any production code free from any warnings just in case something goes wrong its one less thing to look at but am struggling with the use of the GLOBAL command.

I assume all the globals should be set right at the top of the program and is as simple as

Code: GLBasic [Select]
GLOBAL variable_name

for everything used that is a global variable

The example gives

Code: GLBasic [Select]
GLOBAL array_name[]

for defining arrays but if I try

Code: GLBasic [Select]
GLOBAL array_name[][]

I get syntax error.

How do you define a 2 and 3 dimensional array as a global?

Thanks
Gary

Pages: 1 2 [3] 4 5