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 - fuzzy70

#41
I have been slowly collecting items to make my own arcade machine so to speak just for the hell of it & now am another step closer to having all I need to build it.

These are the items I have acquired so far

  • 36 inch TV with built in surround (5.1 DTS, Dolby Pro Logic)
  • Original Xbox version 1.6 (Clear crystal case) modded by me
  • Pair of Half leather car seats from a MGF roadster

All the above items I managed to get for free, the TV was given to me by a friend who replaced it with a 50" Lcd/Plasma, same with the xbox which he gave me a while back when his kids moved over to a 360 & PS3. The car seats came from another friend who was a car dealer that decided to break & sell an MGF he had due to the cost of repairing it was not worth it. Almost all the parts sold except the seats & I was toying with the idea of making a "Top Gear" type sofa with them but that never happened but I do use them as gaming seats though  =D

The items that are remaining to get are a steering wheel controller as well as a SFF pc like an old Dell 3100c etc (which I am currently watching one on eBay thats at £1 N/R & 2 days to go).

The reason for an Xbox & a PC is due emulation mainly, the pc will handle the Amiga & MAME side of things as well as remakes that I have accrued over the years, while the Xbox will deal with the 16bit console stuff (Snes, megadrive, Atari 2600 etc). While there is an Amiga & MAME emulator for the Xbox the Amiga side is not as easy to use or as established as the Windows/PC version & MAME is fine for really old games but struggles with some of the later ones. Also my Xbox games are copied onto the HD thanks to the mod.

I have made up adapter cables that allow me to use Amiga/Atari 9 pin digital joysticks on both the PC & Xbox as well as using an Xbox controller on the PC & all works well regarding that. More than likely I will dig out my PICmicro programmer & make an electronic switch box to save the hassle of cable swapping etc.

Luckily having a Dad who's a carpenter will save me a lot of hassle making the frame & base to hold it all in his workshop (also the trade discount on the wood is a huge bonus). I you think of a Sega Rally arcade game cabinet that's the sort of look I will probably go with.

Once I get the wheel controller & the PC then construction will begin  :enc:

Lee

btw the attached pic is not the seats I have as they are still in my mates unit but are the same type

[attachment deleted by admin]
#42
I have been away for over 2 months thanks to my hard-drive deciding it was time to do an impression of a Geiger counter & merrily clicking away like no tomorrow. That's where being unemployed really sucks as saving up for another took a long time as you can see. I could have bought a 2nd hand one from ebay but I've always been cautious with hard-drives, & cpu's for that matter from there as you cannot tell what abuse (if any) they have had.

Good news, have not lost any data thanks to my regular back-up schedule.

Bad news, I cannot for the life of me find my Windows 7 disc & serial so have had to install Vista which is very odd seeing as all my other OS cd's (even back to win98) are present in my PC disc wallet.

I have learn't 1 good lesson though, you can download full disc images of Microsofts OS's from their site & if you are unlucky enough to have to install Vista like I've just done download one for your sanity.

I honestly thought the updates was never going to end, seriously there was around 60 updates & numerous reboots before I even got to the SP1 download, then more again until I got to SP2. Is it just me or I thought the Service packs incorporated all the previous updates  :blink:

Installing all my apps again & updating them was not really fun but a lot less painful than the Vista experience  :D

Now the fun begins trying to remember what I was doing before & getting back into that mindset, still have a few pages of unread posts on this forum to scan through yet & see whats been happening in the land of GLBasic  :good:

Hope you all had a nice Xmas & New Year btw  :booze:

Lee
#43
Sorry, I had to post this pic here that a friend of mine just posted on FB as it is so apt  :D

Lee

[attachment deleted by admin]
#44
I am thinking of learning another language for the sole purpose of creating my utilities like level editors etc. One such utility I need to create is for reading amiga disks (emulated ADF files not originals) as I am planning on making a remake of a classic amiga/st game. I have been toying with the idea of remaking this game for a couple of years now but Blitz3d (my previous language) was not ideally suited to the task thanks to the game being a strategy type with a lot of data that needs monitoring & updating. Thanks to GLB I think it is possible thanks to its vastly superior TYPES system with functions & arrays of TYPES compared to Blitz3d's very basic TYPE system.

I have managed to read the save game disk & work out how the data is stored which enables me to edit it so effectively cheating the game so I can grab info, graphics etc to build up a framework as well as how the game ticks internally. Btw I have completed the game numerous times many years ago when it came out on the Amiga but that was long ago  =D .

All this was done with Blitz3d & a hex editor & was far from ideal but they done the job, well nearly as still have about 20% or so left to do. What I would like is to wrap up the utils into 1 program with a graphical interface so I no longer need the hex editor & Blitz, same goes for any other tools/utils I have written or will write in future.

I am looking for a visual language so I can design the UI without having the hassle of coding it then just assign the code to the relevant elements, also power/speed is not top of the list as I will only be creating tools/utils & not games with it as I will use GLB for them.

Three spring to mind at the moment, Visual C++, Visual C# & Visual Basic, all of which are free which helps  :D . I have discounted C++ due to the time required to learn it & as previously stated I do not need the power etc that C++ provides.

C# I have no idea about & would like to hear from any of you that have any experience in that language as to how difficult it is to learn.

Visual Basic I used back in 2005 when I wrote my diabetic app for my pocket pc & that was done by reading only the commands I needed to use & nothing more. If I looked at the code now I can safely say that most of it would not make any sense to me so would have to start from the beginning again. Also knowing Microsoft & their uncanny ability to make the next release either incompatible or substantially different to the previous version means starting afresh anyway.

I am not knocking DDGUI that comes with GLB, but like I said earlier I want to spend more time coding the program & not have to worry about coding in UI co-ords & such like, less time spent doing the util means more time to spend writing games in GLB.

Any views on C# would be appreciated as well as any other visual languages that I have missed, keeping in mind that the Visual range from Microsoft comes with the huge .NET library helping to cut the amount of written code down.

Also do not ask what the game is I thinking about doing as there have been numerous posts on the web about a remake of it, all of which vanished without a trace & I do not want to be part of that statistic. Plus I want to write/convert other utils so that one is just an example  ;) .

Lee
#45
Hi all, I am a Type 1 diabetic (insulin controlled) & have been for 17 years. For the last 3 years I have been controlling the amount of insulin I use by a method called "Carbohydrate Counting", which is based on a very simple formula. My real questions will follow after this description to help show whats involved.

(Portion size grams / 100) * Carbs per 100g = CP's (Carbohydrate Points)
10 CP's = 1 unit of insulin
It is then multiplied by each persons personal ratio, everyone starts at a ratio of 1:1 & it is modified over time based on results from blood tests.

The above looks more complicated than it is practice so will gove a real life example

Wholemeal pasta = 66g per 100g of Carbs
Portion size = 200g
200/100 = 2
2 * 66 = 132 (CP's)
132/10 = 13 units of insulin to be injected (assuming 1:1 ratio)

You also have to factor in what your blood sugar levels are prior to eating & make an adjustment dose of insulin which again is based on a per person basis. My blood sugar target range is 4-8mmol/L & my adjust dosage is 1 unit insulin for 2 mmol/L. So using the above example say my blood result was 10mmol/L before the meal, I would have to inject 15 units of insulin (13 for the food, 2 for the correction dose) to keep my levels within my target range.

All is nice & easy with the above but say you had a meal with more than one item like a roast dinner, you have to calculate the CP's for the potatoes, vegatables, yorkshire puddings etc etc separate & add them up. Just imagine the joys of eating out & having a 3 course meal with starter,main & desert then the math starts getting awkward, still straight forward though just more time consuming. After time you learn meals that you have regular so other than adding a correction dose if needed the math is not needed.


Everything above is very easy for a computer/phone to calculate as well as keep track of. I use my pocket pc when I go out as I wrote a VB.Net app for it along with a SQL database to store the info of the foods & it is probably the most simple program you could write. I select the food type from a drop down list which then produces another dropdown listing the types of food in that group, I then enter the portion size & it keeps a total of the CP's as I add more items.

While this works for me it is not very portable to other devices thanks to using Microsofts SQL compact edition. There are programs I have seen on the net but they tend to be limited in some way or another, like American ones which use ounces instead of grams & provide no inbuilt conversion or do not keep a running total of all the items making up the meal. There are books as well, but carrying a book around with you when going for a meal is not the most practical solution. I have one particular book which is very good in that each food has a photo so you can visually see the size of the portion, but again not very portable/practical while out & also while a phone version could be made the size of the download would be rather large (around 1000+ thumbnails). There is an Iphone version of the book but it has the problem I mentioned earlier regarding not keeping a total of multiple foods & looks like an ebook rather than a program.


Now finally to my questions lol.
As mentioned above the program is really nothing more than a calculator with an attached database of foods, the database would have to be implemented as a flat text file which should not pose to many problems. To cover a wide target audience I thought that IPhone/IPod, Android cover a large part of the market but also Windows phone, Blackberry & a generic JAVA app for the remaining targets. While I have used all the targets I have never owned or developed for any of them so if you could help by answering the following questions that would be very appriciated.

What costs are involved, like Developer fees etc so a rough total to produce an app for that platform & market it.

IPhone/IPod =

Android =

Windows Phone =

Blackberry =

Regarding the java side of things can all the above run a java app & would that be the best way to approach this?

Any thoughts on if such a project like this feasable?


As I am currently not working due to illness (& it's not diabetic related) I would have to source funding to pay for any fees etc mentioned above, for that I would approach a Diabetic organisation or such. I could have searched the net for the above information but would rather hear from actual people like yourselves with real world experience as you are aware of any hidden costs not mentioned on their sites. Ideally I would like the app to be free but may charge a small amount & the procedes go to a Diabetic related charity if that is required, if it makes it easier for others with the same condition as myself thats all I am after.

Sorry for such a long post but could not figure out a way to shorten it.

Lee
#46
GLBasic - en / Hex$ & Bin
2011-Nov-22
Is there a way to print hex & binary on the screen or do I have to roll my own function to do it. The latter is not a problem but if it is already built in somewhere there is no point re-inventing the wheel so to speak  =D

Lee
#47
Some of my types are getting rather large thanks to adding functions in them etc. Once I have the type all working as it should I am stuck with a big lump of code at the top which basically gets in the way  :D .

Would sticking them in a SUB at the end of my code & doing a GOSUB setuptypes type of thing work?. If so would help in the short term but if they was foldable that would be better  =D

Lee
#48
Everything was fine until about an hour ago. For some strange reason when I assign a value to a variable sometimes it does not work. I have loaded some of my projects which worked fine a couple of hours ago & they fail so I wrote the following test program & you can see from the pic whats happening in the debug window.

Only strings seem to be affected & with the included example it is just the global ones but I have seen problems with locals in my other projects. I have un-installed & re-installed GLB yet still the same result  :(. Also tried the clean project & no joy

Code (glbasic) Select

// --------------------------------- //
// Project: test
// Start: Sunday, November 13, 2011
// IDE Version: 10.118


// SETCURRENTDIR("Media") // go to media files

LOCAL ltext1$,ltext2$,ltextarray$[],lnum1%,lnum2#,lnumarray[]

GLOBAL gtext1$,gtext2$,gtextarray$[],gnum1%,gnum2#,gnumarray[]

DIM ltextarray$[4]
DIM gtextarray$[4]
DIM lnumarray[4]
DIM gnumarray[4]

ltext1$="local test string 1"
ltext2$="local test string 2"

ltextarray$[0]="local array test string 1"
ltextarray$[1]="local array test string 2"
ltextarray$[2]="local array test string 3"
ltextarray$[3]="local array test string 4"

lnum1%=1
lnum2#=2.34

lnumarray[0]=1
lnumarray[1]=2
lnumarray[2]=3
lnumarray[3]=4

gtext1$="global test string 1"
gtext2$="global test string 2"

gtextarray$[0]="global array test string 1"
gtextarray$[1]="global array test string 2"
gtextarray$[2]="global array test string 3"
gtextarray$[3]="global array test string 4"

gnum1%=3
gnum2#=4.56

gnumarray[0]=5
gnumarray[1]=6
gnumarray[2]=7
gnumarray[3]=8


Any ideas?

Lee

[attachment deleted by admin]
#49
Me & TYPES are getting on like fire & water at the moment. It is bound to be something obvious that I am missing but the "penny is not dropping" so to speak. I think most of it is due to using BlitzBasic/Blitz3d for so long (since my Amiga days lol) that adjusting to the different way GLB uses TYPES is my problem.

I have used GLB TYPES as arrays in a few tests no problem, however with them I knew the size of the arrays in advance so did not come across any problems. I presume you have to use arrays if you want more than one of the same type, again am used to the NEW command in Blitz.

If someone could convert the following Blitz code into GLB code I will be able to make the connection & know in future. I have quite a few code snippits in Blitz that I have wrote over the years & would like to use/convert some of them into GLB .

Blitz code
Code (glbasic) Select

Type Ttest
Field x
Field y
Field layer
End Type

Function addtemp(x,y,layer)
additem.Ttest = New Ttest

additem\x = x
additem\y = y
additem\layer = layer
End Function

Function moveitems(dx,dy)
For additem.Ttest = Each Ttest
additem\x = additem\x+dx
additem\y = additem\y+dy
Next
End Function


My attempt at converting the above to GLB

Code (glbasic) Select

TYPE Ttest
x%
y%
layer%
ENDTYPE

GLOBAL test%[] AS Ttest

//DIM test%[1]

GLOBAL additem AS Ttest


FUNCTION additems: x%,y%,layer%
additem.x = x
additem.y = y
additem.layer = layer
DIMPUSH test[],additem
ENDFUNCTION

FUNCTION moveitems: dx%,dy%
FOREACH loop IN test[]
test%[loop].x%=test%[loop].x%+dx%
test%[loop].y%=test%[loop].y%+dy%
NEXT
ENDFUNCTION


Which fails at compile time with a stream of errors
Code (glbasic) Select

C:\Users\LEEFUR~1\AppData\Local\Temp\glbasic\gpc_temp0.cpp: In function `DGInt __GLBASIC__::moveitems(DGNat, DGNat)':
C:\Users\LEEFUR~1\AppData\Local\Temp\glbasic\gpc_temp0.cpp:90: error: no match for call to `(__GLBASIC__::DGArray<__GLBASIC__::Ttest>) (__GLBASIC__::Ttest&)'
C:/Program Files/GLBasic/Compiler/platform/Include/glb.h:595: note: candidates are: T& __GLBASIC__::DGArray<T>::operator()(int) [with T = __GLBASIC__::Ttest]
C:/Program Files/GLBasic/Compiler/platform/Include/glb.h:640: note:                 __GLBASIC__::DGArray<T>& __GLBASIC__::DGArray<T>::operator()() [with T = __GLBASIC__::Ttest]
C:\Users\LEEFUR~1\AppData\Local\Temp\glbasic\gpc_temp0.cpp:90: error: no match for call to `(__GLBASIC__::DGArray<__GLBASIC__::Ttest>) (__GLBASIC__::Ttest&)'
C:/Program Files/GLBasic/Compiler/platform/Include/glb.h:595: note: candidates are: T& __GLBASIC__::DGArray<T>::operator()(int) [with T = __GLBASIC__::Ttest]
C:/Program Files/GLBasic/Compiler/platform/Include/glb.h:640: note:                 __GLBASIC__::DGArray<T>& __GLBASIC__::DGArray<T>::operator()() [with T = __GLBASIC__::Ttest]
C:\Users\LEEFUR~1\AppData\Local\Temp\glbasic\gpc_temp0.cpp:94: error: no match for call to `(__GLBASIC__::DGArray<__GLBASIC__::Ttest>) (__GLBASIC__::Ttest&)'
C:/Program Files/GLBasic/Compiler/platform/Include/glb.h:595: note: candidates are: T& __GLBASIC__::DGArray<T>::operator()(int) [with T = __GLBASIC__::Ttest]
C:/Program Files/GLBasic/Compiler/platform/Include/glb.h:640: note:                 __GLBASIC__::DGArray<T>& __GLBASIC__::DGArray<T>::operator()() [with T = __GLBASIC__::Ttest]
C:\Users\LEEFUR~1\AppData\Local\Temp\glbasic\gpc_temp0.cpp:94: error: no match for call to `(__GLBASIC__::DGArray<__GLBASIC__::Ttest>) (__GLBASIC__::Ttest&)'
C:/Program Files/GLBasic/Compiler/platform/Include/glb.h:595: note: candidates are: T& __GLBASIC__::DGArray<T>::operator()(int) [with T = __GLBASIC__::Ttest]
C:/Program Files/GLBasic/Compiler/platform/Include/glb.h:640: note:                 __GLBASIC__::DGArray<T>& __GLBASIC__::DGArray<T>::operator()() [with T = __GLBASIC__::Ttest]
*** FATAL ERROR - Please post this output in the forum
_______________________________________
*** Finished ***
Elapsed: 1.1 sec. Time: 00:21
Build: 0 succeeded.
*** 1 FAILED ***


not a pretty sight  :D, tried it with the DIM statement & still fails.

Cheers

Lee
#50
This was only meant to just center text but ended up growing into something bigger  :D. Apologies if another one has been posted but I couldn't see one.

The code is commented above the function but will explain it here anyway. Basically it allows you to print text but adds the following over the standard PRINT command.

  • Text can be justified left, centered or right
  • You can specify a width in pixels if you want to limit text to an area, see next point
  • Text will be wrapped if its wider than the screen or the specified width

Call the function fprint(text$,x%,y%,justify%,width%)

text$ = Text to be printed (obviously) :D
x%,y% = Coordinates of where to print text
justify% = Justify the text, 0=Same as normal print(left), 1=Centered, 2=Right
width%=limit text area width, for example if you wanted to limit the text to 200pixels

The text will automatically wrap if

  • The text goes offscreen, only in the x direction
  • The text is longer than the amount of pixels set in width

The Splitter function is what does the wrapping if the text is to wide to fit, It will search for spaces in the string & split the text at that point so as not to cut off words in the middle. It was part of the original print function but to save a lot of code duplication as well as easy maintenance(<- read as easier debugging  :) ) I split it out into a function of its own.

A word of warning, NO checks are made to see if the text goes off the bottom of the screen.

One strange thing, I built this as an external file to be used with other programs of mine but if i try do DIM the type array I  get an error "(10) error : command not inside function or sub". Only way I found to get it to work was to use a REDIM in the splitter function. If there is another or better way please let me know.

Also let me know if you have any problems with this function or ways to improve it. I have tested it with random text, diff fonts etc & not had any troubles but you might send it something which I have not tried  =D

Lee

Code (glbasic) Select
// Start of a textlibrary

TYPE textlines
txt$
y%
ENDTYPE

GLOBAL wraptext[] AS textlines


// FormatPrint
// ===========
// text$=Text to print
// x%,y%=Position to print text
// justify%=0 left, 1 centre, 2 right
// width%=limit width(in pixels), if 0 then will default to screenwidth
// if you send an x%=0,width%=0 & justify%=1 text will be screen centered

FUNCTION fprint: text$, x%, y%, justify%, width%
LOCAL screenw%,screenh%,fontw%,fonth%
LOCAL textlength%
LOCAL tempx%,wrap%=FALSE

GETSCREENSIZE screenw%,screenh%
GETFONTSIZE fontw%,fonth%

//  Uncomment below if you want to send character widths to function rather than pixels
// width%=width%*fontw%

textlength%=LEN(text$,1)

IF width%=0 THEN width%=screenw%

IF justify%=0 OR justify%=1 AND x%+width%>screenw% THEN width%=screenw%-x
IF justify%=2 AND x%-width%<0 THEN width%=x

IF textlength%>width% THEN wrap%=TRUE
IF width%<fontw% THEN RETURN

SELECT wrap%
CASE 0 // No Wrap
IF justify=1
PRINT text$,x%+((width%-textlength%)/2),y% // Centered
ELSEIF justify=2
PRINT text$,x%-textlength%,y% // Right
ELSE
PRINT text$,x%,y% // Normal(left)
ENDIF
CASE 1 // Wrap needed
IF justify=1 // Centered
splittext(text$,width%)
FOREACH line IN wraptext[]
tempx%=(width%-LEN(line.txt$,1))/2
PRINT line.txt$,x%+tempx%,y%   
INC y%,line.y%
NEXT
ELSEIF justify=2 // Right
splittext(text$,width%)
FOREACH line IN wraptext[]
tempx%=LEN(line.txt$,1)
PRINT line.txt$,x%-tempx%,y%
INC y%,line.y%
NEXT
ELSE // Normal(left)
splittext(text$,width%)
FOREACH line IN wraptext[]
PRINT line.txt$,x%,y%
INC y%,line.y%
NEXT
ENDIF
ENDSELECT

ENDFUNCTION

FUNCTION splittext: text$,linewidth%
LOCAL textlength%,space%,fontw%,fonth%,split$,chrsperline%,loop%,temptext$,splitpoint%
LOCAL done%=FALSE,currentline%=0

GETFONTSIZE fontw%,fonth%
chrsperline%=linewidth%/fontw%

REPEAT
IF LEN(text$)<=chrsperline% THEN done%=TRUE
REDIM wraptext[currentline%+1]
textlength%=LEN(text$)
temptext$=LEFT$(text$,chrsperline%)
splitpoint%=chrsperline%
space%=INSTR(text$," ") //look for spaces in string, for neater splitting

IF space%<>-1 AND done%=FALSE
FOR loop%=LEN(temptext$) TO 1 STEP -1
split$=MID$(temptext$,loop%-1,1)
IF split$=" "
splitpoint%=loop%
BREAK
ENDIF
NEXT
ENDIF

wraptext[currentline%].txt$=LEFT$(temptext$,splitpoint%)
wraptext[currentline%].y%=fonth%
text$=TRIM$(RIGHT$(text$,textlength%-splitpoint%)," ")
INC currentline%,1

UNTIL done%

ENDFUNCTION


FUNCTION printerror: error$
LOCAL txt$

txt$="Program halted, Press anykey to quit"

fprint(error$,0,0,1,0)
fprint(txt$,0,30,1,0)
SHOWSCREEN
KEYWAIT
END

ENDFUNCTION



#51
ENDOFFILE() from the online help is missing its example

Code (glbasic) Select
// Files
test$ = "test.bin"
OPENFILE(1, test$, FALSE)

WRITEBYTE 1, 42
WRITEBYTE 1, -42
WRITEWORD 1, 16767
WRITEWORD 1, -16767
WRITEIEEE 1, 1.234E-4

xx$= "Hello World\nYes, Hello\n"
WRITESTR  1, xx$
WRITELONG 1, 16767
WRITELONG 1, -16767
CLOSEFILE 1

LOCAL b1%, b2%, w1%, w2%, l1%, l2%, ieee
LOCAL x2$, _x1$, _x2$
OPENFILE(1, test$, TRUE)
READBYTE 1, b1
READBYTE 1, b2
READWORD 1, w1
READWORD 1, w2
READIEEE 1, ieee

// READSTR 1, x2$, LEN(xx$)
READLINE 1, _x1$
READLINE 1, _x2$
READLONG 1, l1
READLONG 1, l2
CLOSEFILE 1

LOCAL i%
PRINT "b1="+b1, 0,i); INC(i, 10);
PRINT "b2="+b2, 0,i); INC(i, 10);
PRINT "w1="+w1, 0,i); INC(i, 10);
PRINT "w2="+w2, 0,i); INC(i, 10);
PRINT "ie="+ieee, 0,i); INC(i, 10);
PRINT "st="+_x1 + "-" + _x2, 0,i); INC(i, 10);
PRINT "l1="+l1, 0,i); INC(i, 10);
PRINT "l2="+l2, 0,i); INC(i, 10);

SHOWSCREEN
MOUSEWAIT


OPENFILE(1, "test.txt", FALSE)
WRITELONG 1, 1234
WRITELONG 1, 5678
WRITELONG 1, 9911
CLOSEFILE 1

LOCAL i

// 1234
OPENFILE(1, "test.txt", TRUE)
DEBUG "pos(0)="+FILEPOSITION(1)+"\n"
READLONG 1,i%; DEBUG "read="+i+"\n"

// 1234
FILESEEK(1, 0, 0)
DEBUG "pos(0)="+FILEPOSITION(1)+"\n"
READLONG 1,i%; DEBUG "read="+i+"\n"

// 1234
FILESEEK(1, -4, 1)
DEBUG "pos(0)="+FILEPOSITION(1)+"\n"
READLONG 1,i%; DEBUG "read="+i+"\n"

// 1234
FILESEEK(1, -12, -1)
DEBUG "pos(0)="+FILEPOSITION(1)+"\n"
READLONG 1,i%; DEBUG "read="+i+"\n"

// 9911
FILESEEK(1, 4, 1)
DEBUG "pos(0)="+FILEPOSITION(1)+"\n"
READLONG 1,i%; DEBUG "read="+i+"\n"

CLOSEFILE 1



As you can see there is no ENDOFFILE() command in the example in the help file

I worked out how to use it but might be a good idea to correct the help file for people that are new to GLB
#52
The first time I came across types was in BlitzBasic & once I had worked out how & when to use them it made certain tasks easier to manage.

Now having moved over to GLB I have the option of having functions in types which I am having trouble working out where & how I could use them. I have adjusted to they way GLB uses types & even arrays of types but what I need is an example of what use functions are in types & the benefits.

I do not need any code examples, although could be useful if it helps the explanation, but just some general description of usage etc.

Thanks

Lee
#53
GLBasic - en / Machine Specs
2011-Nov-08
Just an idea as I could not seem to find it in the forums (as it probably does not exist).

A list of the specs from the various targets GLB can compile for I feel would be quite useful & would help with the planning of a project if you had other targets in mind. I don't mean full on specs down to cpu speed etc but just the basics, for example


       
           
           
   

                Platform

                OS

                Resolution

                Input Methods

                Pocket PC

                WinCE

                240x320

                Touchscreen, 6 Buttons, 1 Dpad

While there is some info in the online help not all targets resolutions are there for example. Obviously targets like Windows/Mac/Linux do not need to be listed & Android for example may be a problem due to the amount of devices it runs on. The example above is just a rough outline (and yes I do know that some Pocket PC's have higher resolutions) of what I mean.

Unlike a lot of members of this forum my list of targets is tiny, Numerous PC's running Windows & Linux, a G4 Mac (which is only really used as a file/print/web server) & a IPAQ PPC. Also I am still currently learning GLB so multi target projects for me are a little way off but something I would definitely think about in the future.

Any thoughts or comments on this are more than welcome & if such a list was made into a sticky for example I feel it would be useful to quite a few people.

Lee
#54
Off Topic / Bloat
2011-Nov-06
Time came today when I finally decided to reformat my drive & re-install win7 as over the past year with adding & removing programs etc things where getting a bit messy & sluggish. Another reason was to remove some bloat as well & look for alternatives. For example I have now ditched iTunes due to it taking up way to much memory while running (300mb+ ram on some occasions) & now have MediaMonkey, a move I should have made ages ago if I was aware of it as memory usage has now dropped to 50-60mb & has far more features than iTunes as well as superior tag handling/editing (way smaller download as well).

Another one to go was Adobe reader as I went on the download site to be greeted by a 64mb download just to view pdfs, I admit reader must do other things as well but they are something I have never used & as such it doesn't warrant a download to me. Also when did Adobe get so poor that they need extra revenue by asking you if you want McAfee security suite & there was something else on the flash download which I just skipped.

While the downloads of the above packages are on the rather large side for what the provide & I think I found out why. What happened to the days when you selected exactly what you wanted to install including what language. Seems now that you don't get the option & they install every language that exists, while some of you are multi-lingual can you speak 30+ languages?, I doubt it lol.

All the extra stuff they throw in as a pain & just causes hassle. If you have a SSD drive then space is a luxury that you try to keep under control & even if you have a old school HD all the extra bloat serves nothing more than to increase defrag times (which is a thing you want to do the least on SSD's) disk checks etc etc.

BTW if you are a Mac user do not think you are immune to disk fragmentation, while apple does it's best to automatically keep your disks frag free it's far from perfect, just download iDefrag & look at your drive.

Developing software tends to create more fragmentation than most other pc activities due to compiling/linking/intermediate files etc, web browsing is another with streams of small files slowing filling the cache.

Right that's my rant over  :D, Just needed to get it out of my system & air it  :rant:
#55
for example http://sourceforge.net/projects/shivavg/, ShivaVG is an open-source ANSI C implementation of the Khronos' OpenVG specification for hardware-accelerated vector graphics API. It is built entirely on top of OpenGL.

That's just my personal preference as while I enjoy playing 3D games I have no interest in writing them  :D

Lee
#56
Wasn't to sure if to post this here or the off-topic section, will leave that decision to the moderators  :D

While trawling through the net I cam across the Allegro Sprite Editor (ASE) at http://www.aseprite.org/

It was recently updated in September & despite it's name it is not tied or for exclusive use with Allegro. Looking through the features it seems to be pretty capable & might be useful for some & I will be giving it a play around later.

At the moment I tend to use GIMP & Fireworks CS5 for my bitmap gfx & occasionally (this will make some people laugh) Dpaint/PPaint on my Amiga emulator. Tools for working with Sprites/Bitmaps are not as easy to find I feel as most programs tend to focus more on Photoediting or Touchup.

If anyone else uses a tool for Sprites or Bitmaps please post them here with what you feel helps with the creation process.

Thanks

Lee
#57
The logo game continues with earnest lol. Just a quick question asking if there is a better way to do the following.

Code (glbasic) Select
// Check Mouse zone
FUNCTION MouseArea:
LOCAL gamegrid
IF mx>=10 AND mx<=228 AND my>=10 AND my<=228 THEN gamegrid=TRUE // Mouse clicked in Playarea
IF mx>=200 AND mx<=206 AND my>=270 AND my<=276 THEN colour=0 //  ""     ""    on Blue Option
IF mx>=207 AND mx<=213 AND my>=270 AND my<=276 THEN colour=2 //  ""     ""    on Red Option
IF mx>=214 AND mx<=220 AND my>=270 AND my<=276 THEN colour=4 //  ""     ""    on Green Option
IF gamegrid THEN PieceClicked((mx-10)/22,(my-10)/22)
ENDFUNCTION


Ignoring the gamegrid variable for the moment (it's a left over from a test earlier) as that can be moved back on the end of the IF statement. The colour variable just basically allows the changing of the game colours while playing. The above code works fine but just somehow looks odd to me with the multiple AND's & was just wondering if there is a better or alternative method as i may be adding over zones to be checked.

Screenshot attached to help, although they are just working gfx & may (prob will) change.

Cheers

Lee



[attachment deleted by admin]
#58
Off Topic / Logo game help
2011-Nov-02
I presume this is the right place to post this as technically not GLB related regarding coding etc.

As I am still learning GLB I thought that rather than browse through the commands writing little bits here & there, I would instead take the LOGO game tutorial & expand on it. For example do up the graphics, add sound,  title screen etc etc, that way I can pretty much use a lot of the graphics commands & others.

One of the features I thought of adding was some kind of scoring (along with a high score table for example) & one way I could implement that was get the computer to solve the puzzle & work out the minimum amount of clicks required to complete it. So as an example the bonus score is say 1000 points & the pc works out that 45 clicks is the minimum to solve it, for every click over 45 the bonus drops 100 points or something.

Writing the code to solve it will not a problem, the problem is (rather embarrassingly) that I cannot get my head around the tactic/strategy to solve the puzzle myself lol.

It's just one of those puzzles that I cannot figure out, the rules are so simple & more than likely the solution is as well but its just not popping in my head  :rant:. I done a search on the Amiga LOGO game which its based & drew a blank, even got the Amiga version & that's harder as it has a timer which counts down from 1 minute (seeing as I can spend 10mins & still not get past level 1 on the tutorial one the Amiga one does not help).

If anyone knows the tactic or if there is another name for that puzzle (can't really see the Amiga version being an original, but who know's) that I can search for that would be very much appreciated. I have saved the scoring system till last on my to-do list so no rush for answers & if no joy will have to think up another way to score the game, other than the amount of clicks it takes the player as it currently stands.

Cheers

Lee

I can understand if nobody replies for some time while they are busy ROFL at this  :noggin:
#59
Just a quickie. While playing around with the font creator program I had a problem with colours while using opengl commands. The 1st print works perfectly (excuse the colours, they was planned that way as to see the shadow & outline where working), however the 2nd one came out dark (see attached pic).

After a lot of head scratching & commenting/un-commenting the code it works out the glColor3f(0.2, 0.2, 0.2) was to blame, if you set it back to glColor3f(1,1,1) before using print again it comes out as it should.

Just thought I would mention it in case someone else came across it & save them the joys of wondering whats going on  =D

the testcode (obviously you need a font to load with some colour in it)

Code (glbasic) Select
SETCURRENTDIR("Media")
LOADFONT "smalfont6.png",1
SETFONT 1

//SLEEP 5000
PRINT "Hello", 10,10

glClear(0)

starttime%=GETTIMERALL()

glColor3f(0.2, 0.2, 0.2)
FOR x%=0 TO 799
FOR y%=0 TO 599
//SETPIXEL x%,y%,RGB(100,100,100)
glBegin(GL_LINES)
glVertex2f(x,0)
glVertex2f(x,599)
glEnd()
NEXT
NEXT
//glColor3f(1, 1, 1)
totaltime%=GETTIMERALL()-starttime%
PRINT totaltime%,100,100
SHOWSCREEN
MOUSEWAIT
END


[attachment deleted by admin]
#60
Hi All,

I have just downloaded GLBasic the other day having come from a background of Blitz3D, Purebasic & minimal amount of VisualBasic.

Getting used to the syntax & differences is slowly getting there but time will sort that out :)

While learning GLBasic I am currently reading the OpenGL Bible & playing around with /common/gl.bas include. The speed difference is quite noticeable using OpenGL compared to the in-built commands I have tested so far, only pixels & lines at the moment. For example to fill the screen (an 800x600) using SETPIXEL takes around  259ms on my system, using glVertex2f to plot the same pixels takes 11ms on average. Lines as well show a big speed increase also but this is not the reason of my question lol.

Is there anyway of adding the glGetString() command/function to the gl.bas code?. The GLOBALS for GL_VENDOR, GL_RENDERER, GL_VERSION & GL_EXTENSIONS etc are all defined but I am unable to get the results from them due to lacking glGetString(). I noticed the functions in gl.bas are inline & contain C code (could be C++ as far as I know as never got passed helloword.c  :-[ ).

While it is not extremely urgent or in some respects required, but might come in handy for checking capabilities etc of the machine on which the code is running, the book mentions using GL_EXTENSIONS to check if a feature is supported & hence the reason for this question.

Regards