Weird GLBasic problem

Previous topic - Next topic

makis

Hi all
I've just downloaded GLBasic in order to compare it to BlitzMax. Many times i thought of learning programming however all my attempts failed miserably! when i try to run the "hello world" example thescreen goes blank and nothing happens! The programm returns to the GLBasic IDE!

Any help would be much appreciated!

System Specs
Win XP SP2 + all updates
6600 C2D
8800GTX 768Mb ram

P.S
Any links to good GLBasic tutorials besides the ones mentioned in the Tutorials subforum?

Moru

Hello and welcome to the wonderful world of GLBasic :-)

There is some tutorials in the help if you press F1 and look thru the contents tab on the top left.

As for your problem with the hello world example, if you activate the debug mode you should get an error message. You activate debugging in the menu "Compiler" -> "Debug mode". Try that and see if it works. Also make sure you have the latest version by using the menu Web -> Internet update each day, there is very often a new version.

makis

Thanks for the reply Moru, however the problem remains unsolved.
Due to the lack of tutorials i lean towards BlitzMax or Playbasic!

amarliani

Ahm.. just a quick thought: How's your code? If it just looks like this:
Code (glbasic) Select
PRINT "Hello world!",10,10
SHOWSCREEN


this behaviour is just normal, because nothing behind the SHOWSCREEN says that the program should wait, so it goes to the next expression - which is an implicit END 'cause nothing else ist there. Try putting KEYWAIT after SHOWSCREEN. This orders the program to wait for you pressing any key to end the run.

makis

Still the same. A window opens up (displaying the ''hello world'' text i suppose) and it disappear instantly.

FutureCow

Please post your complete code.

You should find plenty of examples and a tutorial in the "help" (F1) to get you going.

Blitzmax will have a LOT steeper learning curve as it's based around OO programming.

Hatonastick

#6
Hmm if you want to learn to program, BlitzMax is not the one for you.  For a BASIC-like language it is fairly advanced and you need to put a lot of work into it to get something useful out of it.  Heck, you almost might as well go out and learn C++.  PlayBASIC is more games orientated than BlitzMax and a little easier to use (but not much).  I'm not a fan of the way Kevin chose to do the language syntax though.  That really isn't a beginner language either to be honest.  If you decide GLB isn't for you, you might want to consider GameMaker, but ignore the drag and drop parts and get into the scripting side.  Personally I own BlitzMax, Blitz3D, Blitz 3D SDK, DarkBASIC Pro (and most of its add-ons), PlayBASIC, PureBASIC, GameMaker and GLBasic, but GLBasic is the only one I use now.

Firstly you didn't respond to the suggestion as to whether or not you did an update.  You are using GLB version 6.164 right?

Do the other samples that came with it work ok for you?  Or do you get the same sort of issue?  Standard place the samples are 'saved' when you first start the IDE is My Documents\GLBasic\Samples\ (but I think you already found them).

You do have the latest drivers for your graphics card too right?  GLBasic uses OpenGL due to it being cross platform unlike DirectX.  I don't imagine that this is the problem though as you aren't running Windows Vista, which is where there were a lot of problems when it first came out due to card manufacturers leaving out OpenGL support for some cards.  That and you are using a NVidia chipset.  I've always had more issues with OpenGL under (some versions) of ATI cards.  Quite frankly the wide variety of cards, the on-the-cheap nature of development and construction of some of them (eg. an Nvidia chipset doesn't mean the card is made by Nvidia.  Same for ATI etc.), drivers and lack of any real guidelines for driver development has led to a massive headache for any developer of computer games on the Windows platform.  That's one of the reasons why they like consoles more -- standardized hardware.  It's been worse for MMO developers as the life of their software (if it survives) can last for years -- and as new cards are being manufactured all the time... Well...  You can imagine.  Anyway if none of the samples work for you, or you get odd behavior for all, then the graphics card drivers would be my main suspect.

This might sound daft, but in the Project menu, click on Options: WIN32 is selected in the Platform Configuration right?

This should give you a window with 'Hello World' in it, then close when you click the mouse button.  It isn't really that much different to what has already been suggested but I thought it was worth a shot.

Code (glbasic) Select

PRINT "Hello world!", 10, 10
SHOWSCREEN
MOUSEWAIT


Lastly, as FutureCow suggested, if you ever have a problem with something not running it's best to post the code being used.  Although it does sound in this case as if you are just running the sample and not altering it.

Edit: Edited multiple times due to just getting up, and not having had coffee yet.  Argh!

makis

Here is my code:
PRINT "helo world" ,100,200
SHOWSCREEN
KEYWAIT
END

I've allready created a game with Gamemaker using the drag and drop icons. It's a remake of Pharoh's Tomb an old DOS platform game.
Even though it is much easier and quicker for me to create a game with GM using D&D, when it comes down to coding using the Gamemaker Language (GML) i get confused. All these step events, timers etc are quite complicated!

MrTAToad

I would set a default screen resolution, and thus the code becomes :

Code (glbasic) Select
SETSCREEN 640,480,1
PRINT "hello world" ,100,200
SHOWSCREEN
KEYWAIT
END


Press F8 to compile, after which press F5 to run it.

Hatonastick

#9
Yeah that side of GameMaker is quite hard.  I'm hoping you'll give GLB a go.  It's pretty easy to get results with it.  We just need to work out what the problem here is.

Oh, BTW the other main reason why I like GLB over the other languages: This forum is by far the best of any of those languages I just mentioned.  That and Gernot supports his product and listens to the people who use it.  That's pretty rare.

Hmm ok that example code works fine for me.  I get a small window with the text in the bottom right quadrant.

Edit: My brain wasn't functioning.  I would up the resolution to 1024, 768 for full screen though as minimum, as some of the newer cards don't support the 'traditional' low end rez modes.  Course that issue wouldn't affect a window on a screen, hence why I removed what I typed earlier.  My brain really isn't awake yet...

FutureCow

#10
As per the earlier two postings, maybe either you're having a resolution problem, or if your output is in a window then your window may not be on the screen.

Let us know if the suggestions by MrTAToad or Hatonastick work.

Hatonastick

I'd be listening to MrTAToad.  The Hat is non compus mentis this morning due to lack of sleep and coffee, and it shows.  :S

MrTAToad

#12
It is so nice to get very regular updates - its something you wont get with BlitzMax - or DBPro for that matter.  Plus the updates actually fix problems first time too! All hail Gernot!

Anyhoo, my code does work - if you just get a blank screen (and there is no reason why it should happen), use :

Code (glbasic) Select

SETSCREEN 640,480,0


to replace with my original one.

QuoteI would up the resolution to 1024, 768 for full screen though as minimum, as some of the newer cards don't support the 'traditional' low end rez modes
I haven't see a card yet that can't handle 640x480 :)


FutureCow

If all else fails, make sure your OpenGL drivers are up to date.

makis

still no luck guys. I suspect it's a driver issue.
How do i update the opengl drivers? sorry to be a a pain but it started getting on my nerves :S