Menu

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.

Show posts Menu

Topics - 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
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
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
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
#46
would it be possible to show which array has thrown up the error rather than just the following being shown in debug window

Code (glbasic) Select

bounds: [   0]
access: [   0]
bounds: [   0]
access: [   0]


If you have a line with several different arrays being accessed it would save a lot of time if it showed the array name that is causing the problem

Gary
#47
GLBasic - en / DLL Wrapping
2011-Feb-01
I have followed Kittys tutorial on this but when I try to use a different DLL file I am having problems.

I have a DLL to control an external USB device and am starting off by trying to send a simple wake up call to the device

The C prototype for the function is as follows

Code (glbasic) Select

10.3 OpenMHE
10.31,1 Synopsis
This call is made by the PC application software to open the "Money Handling Equipment" Interface.

long OpenMHE (void);

10.31,2 Parameters
None

10.31,3 Return Value
If the Open call succeeds then the value zero is returned.
In the event of a failure one of the following standard windows error codes will be returned, either as a direct echo of a Windows API call failure, or to indicate internally detected failures that closelycorrespond to the quoted meanings.
Error Number  Suggested string for English decoding        Microsoft Mnemonic    Retry
13            The DLL, application or device are at
              incompatible revision levels.
                                                           ERROR_INVALID_DATA    No
20            The system cannot find the device
              specified.
                                                           ERROR_BAD_UNIT        No
21            The device is not ready.                     ERROR_NOT_READY Yes
1167          The device is not connected.             ERROR_DEVICE_NOT_CONNECTED Yes


the code I am using in GLBasic to try to set up this function is as follows

Code (glbasic) Select
WHILE KEY(28)=0 // wait for return to exit
DEBUG OpenMHE()
WEND


INLINE
extern "C" {
DECLARE_ALIAS(exportOpenMHE, "aesimhei.dll", "OpenMHE", (void), long);}
ENDINLINE

FUNCTION OpenMHE:

INLINE
IF(exportOpenMHE)     
RETURN exportOpenMHE();
ENDINLINE

ENDFUNCTION


when I try to compile this I get the error

Code (glbasic) Select
C:\DOCUME~1\Owner\LOCALS~1\Temp\glbasic\gpc_temp0.cpp: In function `int __GLBASIC__::__MainGameSub_()':
C:\DOCUME~1\Owner\LOCALS~1\Temp\glbasic\gpc_temp0.cpp:79: error: expected unqualified-id before string constant
C:\DOCUME~1\Owner\LOCALS~1\Temp\glbasic\gpc_temp0.cpp: In function `DGInt __GLBASIC__::OpenMHE()':
C:\DOCUME~1\Owner\LOCALS~1\Temp\glbasic\gpc_temp0.cpp:114: error: `exportOpenMHE' was not declared in this scope
C:\DOCUME~1\Owner\LOCALS~1\Temp\glbasic\gpc_temp0.cpp:114: error: `IF' was not declared in this scope
C:\DOCUME~1\Owner\LOCALS~1\Temp\glbasic\gpc_temp0.cpp:116: error: expected `;' before "RETURN"


I have about 20 commands I need to wrap but if I cant get this one running there is no point in carrying on lol

I can provide the DLL file if anyone requires it to be able to help

Thanks in advance
Gary
#48
GLBasic - en / Mac app store
2011-Jan-07
Does anyone know if GLBASIC can compile for the new mac app store as is or will it need an update and if so will it be supported in the future?

Thanks
Gary
#49
This is not a bug but more a tip for us non regular Mac users which should save quite a lot of reboot time

I know there is a Mac IDE being worked on but I can fully recommend using Parallels to run windows while running OSX. There is a very nice mode called coherence that runs windows in the back ground but opens the active windows program on the Mac desktop. Very nice for opening the GLBasic IDE, compiling the code, testing it as a PC exe, then compile the iPhone version, open it in xcode and run on the device, all from OSX.

I admit I got the Mac Mini just to compile iPhone code written in GLBasic, but the more I explore the actual Mac OS the more I am warming to some of the features and starting to use OSX more and more as an operating system
#50
Nothing at all to do with GLBasic but hoping some resident iPhone dev can help me

I recently had to reinstall OSX and have lost all my certs and keys for the SDK. I have reinstalled the SDK, followed the instructions on the apple provisioning assistant and downloaded my exisiting keys and certs but in the keychain I am not getting the matching pair as shown on the apple screen shots and therefore it wont let me compile.

Anyone got any ideas?
#51
Apologies if this is elsewhere but i cant see anything via search

having taken a brief break from GLBasic to cross to the dark side (I had to use BlitzMAX for a PC project as the hardware board I was using only had a plug in for Blitz :( ) I have come back to find a nice suprise in v8.

I tried to update from 7.34100 to 8.0000 on 2 computers now (one at work, one at home) and both give this error after clicking start update from the update manager

Runtime Error
Program: C:\Program Files (x86)\GLBasic\Update_E.exe

This application has requested the Runtime to terminate it in an unusual way.
Please contact the applications support team for more information

One of the computers is Windows 7 64 Bit, the other is windows XP 32bit

Anyone else had this problem and any ideas how to fix it?

Regards
Gary
#52
I am writing a simple PC program for a sports timer that I want to play a random MP3 file while a game is not being played.

I have everything working fine on my dev PC but when I try it on another PC whenever a call is made to play an mp3 the program just quits out. Also a couple of testers have found the same problem.

Is there any codec needed to be installed to allow GLBasic to play MP3s? I will upload the full source if it would help anyone in seeing where I am going wrong

The exe file can be downloaded at www.subbuteoplayersforum.com/fistftimerv2.exe

Cheers
Gary
#53
I dont know if this is something I am doing or if it is a bug in GLBasic

I am loading my graphics and then switching to a folder containing MP3s which will play at random

My code is this

Code (glbasic) Select
SETCURRENTDIR("Media") // seperate media and binaries?

LOADFONT "smallfont.png", 1
LOADFONT "medfont.png",2
LOADFONT "largefont.png",3
LOADSPRITE "num0.png",0
LOADSPRITE "num1.png",1
LOADSPRITE "num2.png",2
LOADSPRITE "num3.png",3
LOADSPRITE "num4.png",4
LOADSPRITE "num5.png",5
LOADSPRITE "num6.png",6
LOADSPRITE "num7.png",7
LOADSPRITE "num8.png",8
LOADSPRITE "num9.png",9

LOADSPRITE "bg.png",200

SETCURRENTDIR("MP3")
musiccount = GETFILELIST("*.mp3",list$[])


I have 2 directories in my project folder Media and MP3 and I would have expected SETCURRENTDIR("MP3") to have switched to the MP3 folder but the files returned by GETFILELIST are the ones in Media.

Is it a bug or am I being stupid?

Thanks
Gary
#54
Does GLBasic allow any read and writes to an RS232 port? All I can see is stuff for TCP and sockets but nothing for basic RS232 send and receive

Thanks
Gary
#55
Is there a simple way of rotating and resizing a screen before the showscreen command? What I am try to do is port my iphone app to the gp2x quickly and obviously the main difference is the screen size. Rather than redo all my graphics I want to just use the standard iphone graphics and then before displaying I rotate and resize for the gp2x.

Thanks in advance

Gary
#56
I have checked the manual, searched for forums but cannot see where I am going wrong when I try to use ?DEFINE

I am porting some C code and it has heavy use of #DEFINE which I assumed I could just swap for ?DEFINE but it seems im doing something wrong

This is some example code

Code (glbasic) Select
?DEFINE SPIN_TO_WIN 1
PRINT SPIN_TO_WIN,0,0
SHOWSCREEN
KEYWAIT


and this displays 0 instead of the 1 I expected.

Thanks for your help

Gary
#57
Im having a stupid moment and cannot get my head around how the best way to read and write a file using GLbasic for an iPhone app

Basically on start up I want to read a file in that contains things like high score and game stats. Also I want to generate a random string the first time the app is run to identify the users iPhone for an online high score chart.

What I would like to know is whats the best way to check if a file exists, create the file if it doesnt exist (this would be done on first run only), read in the file, copy the variables to the game at run time and to write the variables back out at the end of each game.

Some of the data will be stored in an array, other will just be standard variables and strings

If anybody has any example code to do this and you can share it then it would be much appreciated

Thanks
Gary
#58
Now my first project is sitting with Apple waiting for approval I thought I would look as my next one.

I am going to do a maze type game and the way I wish to do it is to have the player in the centre of the screen at all times and have the maze scroll round them as the maze is much bigger than the iPhone screen.

The way I planned to do it was to have 2 sets of graphics, one of just 2 colours for the maze and player which would be easy to check for collisions and then a full colour version that will be the displayed graphics. The maze will be about 1500x1500 pixels and I was planning on showing the correct area by using negative co-ordinates for the draw position so I do a single draw command rather than displaying a load of blocks.

My question is though looking at the sprite collision commands they seem to need to check by specifying actual co-ordinates of the sprites in question. If I was to make the map 2 colours with the walls a solid colour and the maze a transparent colour would the collsion detection only come in when actual pixels touch or does it just look at sprite sizes and say they overlap?

Thanks
Gary
#59
Is there a simple way im missing if using DIMDATA on a 2 dimensional array? From the manual it seems to only work on single dimensions


Thanks
Gary
#60
Sorry for all the questions, hope i'm not annoying you all too much.

I have got the main framework of my project running on the PC so thought I would port it over to the iPhone to see how the graphics speed was on there. I did as I have done before, built it for iPhone, took the files to the mac and ran xcode but get the error

Unable to open project

Project /Users/garypearson/Desktop/RandomGold/XCode/GLBasic/iPhone.xcodeproj cannot be opened because the project file cannot be parsed.

anyone else had this problem and any ideas on how to fix it?

My xcode version is 3.2 and the other info is

64-bit

Component versions
Xcode IDE: 1610.0
Xcode Core: 1608.0
ToolSupport: 1591.0

Thanks again
Gary