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

Pages: [1]

I need to create a lot of basic objects at runtime, in 3D, so I need to "group" (combine) objects to reduce the draw-calls.
Is there any native function in GLBasic to do that? Or is there someone who was able to create such function?

Thank you for help!

GLBasic - en / Two questions...
« on: 2008-Jul-13 »
Day by day I'm discovering this great product.
Now I found two "small" problems:

1) How can I include a source code inside another one (something like "include" or "import")?
2) Can I set screen resolution, Fullscreen, more than 1024x768?
3) Does GLBasic support video other than 4:3 (e.g.: 1024x600? 1440x900? 1680x1050?)

Thank you!


I cannot find a function to change screen resolution via code, how can I do it?
(for example, I want to let the user change game resolution).

Thank you (even without restarting the game!)

Math / Small calc optimizations
« on: 2008-Jul-12 »
Hello, I'm new in GLBasic, and this is my first official post!  :booze:

I wish to give my contribute in calculation optimization (tricks!).

1) I noticed that many people, to get a sprite rotating (forever!), they use something like this:

Code: GLBasic [Select]
counter = 0
while true
  inc counter, 1
  if counter >= 360 then counter = 0

Even if it is correct, using an if is usually a "slow" procedure. Istead, you can use this code:

Code: GLBasic [Select]
counter = 0

        INC counter, 1
        PRINT MOD(counter, 360), 100, 100

In this way, the "mod" makes the "dirty" job, and it is faster than using "if".

Another trick is about values switching:

1) true -> false -> true ....
2) 1 -> 0 -> 1 -> ......

You can use the following code:

Code: GLBasic [Select]
boolValue = FALSE

        boolValue = BNOT(boolValue)    
        PRINT boolValue, 100, 100


FOR "1" AND "0" ......

Code: GLBasic [Select]
boolValue = 0

        boolValue = 1 - boolValue
        PRINT boolValue, 100, 100


In order to see the result, you can put, in the first line, an FPS limiter:

limitfps 3 ; 3 frames per second.

I hope this small tutorial will help some people! (my 0.02$ contribution!)


I'm evaluating some tools to make a game.
Since I need to make a game, I wish some "objective" information to better understand if GLBasic is the right tool, or if is better that I look for other programs.
I tried to find these information in the forum and in the web, but it is hard to get definitive answers (I hope you could help me).
First of all, I want to say that I'm a programmer. I need to create a game with 2D top-view (not isometric, but with camera seen on top).
Basically I want to make a 2D application (with editor, and modding features, and implementing "newLisp -" as scripting language), but using 3D sprites (to better move, rotate and render the vehicles and other things).
Obviously, I know that something can be done, but I'm alone, so I hope I can do them without too much workload (I need some pre-made functionalities, just to speed-up my job).

1) Can I create 2D tiled backgrounds with sprites in 3D? (real 3D sprites model over a 2D tiled background).
2) Can I implement a physic engine without too much workload (newton physics? ODE? Chipmunk 2d? or... ?)
3) Can I realize viewports (I need to get more "views" of the game in the same screen. For me a view is a "window" inside the game. Two views are like two camera working at the same time).
4) Can I work on a sprite canvas (or other images) in real time (to apply some special effects)?
5) Can I insert C code in the source code (like one do with assembler)?
6) Can I apply light effects in real time (like day-cycle)? Yes I know I'm talking about 2D game, but some nice light effects could be applied also. And can I realize a kind of shadows?
7) When I load an image, does it automatically go in the video card RAM, or I can manage that process manually (e.g.: I want to load some sprites in background, with a thread, then I "send" only needed images to the video card, after a CPU preprocessing and only when needed, just to avoid to fill video card memory).
8) Which direct X version use PB? (DX3? DX7? DX8? DX9?)

I know I made many questions, I'm sorry, but I really need such answers in order to avoid to spend many months with the wrong tool.

I found possible alternatives, but PB seems very good:
1) Pure Basic(but it seems more general application oriented, not much game oriented).
2) Blitzmax (but its development seems blocked, only updates are made).
3) I use Delphi in my official job, but I cannot find any good, updated library to make the games.
4) Play Basic seems not really compiled (I made some tests and the p-code seems slow).

Thank you to everyone for your patience!

Pages: [1]