GLBasic forum

Main forum => GLBasic - en => Topic started by: snurty on 2009-Apr-17

Title: 3d on GP2X
Post by: snurty on 2009-Apr-17
I am considering using GLbasic for making GP2X games. I presently use Fenix but I want to do some basic 3d stuff that Fenix can't do.

I have the demo version of GLbasic and have got basic hello world programs running on the gp2x but I can't get anything running using 3d. Just a simple square made via X_OBJSTART wont seem to work although it runs ok on the pc.

When switching files over I am just moving the GPE and MMUhack files. Do I need to do anything special to get 3d stuff running on GP2X?

I have the latest version of GLbasic and have searched the forums and note the xfield constraint but can't find a possible answer.

Any help much appreciated.
Title: Re: 3d on GP2X
Post by: Schranz0r on 2009-Apr-17
Use X_MAKE3D 1,100,45
Title: Re: 3d on GP2X
Post by: snurty on 2009-Apr-18
Thanks for the response but unfortunately I had this already. My very simple code is below and this runs fine on the PC and it runs to an extent on the GP2X as the demo logo comes up in the top left just that the rest of the screen is blank. Any ideas?

spin=0


X_OBJSTART 6
  X_OBJADDVERTEX -20, 0, -20, 0,0,RGB(150,0,50)
  X_OBJADDVERTEX -20, 0, 20, 0,0,RGB(150,0,50)
  X_OBJADDVERTEX 20, 0, -20, 0,0,RGB(150,0,50)
  X_OBJADDVERTEX 20, 0, 20, 0,0,RGB(150,0,50)
X_OBJEND


WHILE TRUE

spin=spin+1
IF spin>359 THEN spin=0

  X_MAKE3D 1,100, 45
  X_CAMERA 0, 20, -40, 0 ,0 ,0
  X_MOVEMENT 0, 0, 0
  X_ROTATION spin, 0, 1, 0
  X_DRAWOBJ 6, 0
  SHOWSCREEN
WEND
END
Title: Re: 3d on GP2X
Post by: kamakazieturtle on 2009-Apr-18
I'm not as good as these guys, but I don't think you need "End" at the end of the code. Worth a shot.
Title: Re: 3d on GP2X
Post by: MrTAToad on 2009-Apr-18
The END statement is irrelevant in this case.  But anyway :

Are you using the latest version of GLBasic ?  And do you have the latest updates on the GP2X ?

It would be worth trying some of the examples and see if they work - if they do, then its possible the X_OBJ wont work.
Title: Re: 3d on GP2X
Post by: snurty on 2009-Apr-19
Thanks for the suggestions. I have removed the End at the end if that makes sense and no difference.

I have the latest version of GL basic and I am running firmware 2.0.0 on the GP2x - this isn't the latest but I have a fear of bricking it when changing firmware.

I have switched over just the gpe file and mmuhack one. Should I have installed any other files on the gp2x?

When running the compiler it does state

Q:\Compiler\platform\GP2X\Lib\libGLBasicGP2X.a(gf_sockets.o): In function `netGetLocalIPs(int*, char const*)':
gf_sockets.cpp:(.text+0x50c): warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking

Does this mean anything?
Title: Re: 3d on GP2X
Post by: FutureCow on 2009-Apr-20
I don't have a GP2x so I'm not any authority on this whatsoever  :whistle:
Kitty Hello is the appropriate person to answer the question. I interpret the output as saying that there is a library problem when compiling code for the GP2x - but as the error is in relation to networking code, is only a warning and not an error, and you're not doing anything network related, I doubt the "warning" is relevant to the problem.
Title: Re: 3d on GP2X
Post by: snurty on 2009-Apr-20
Thanks futurecow.

Well I put a mousewait in after showscreen as the screen appeared to flash just for a second. The mousewait shows the first frame displays the correct shape although the fill is pretty broken up. The next frame onwards is blank.

Is this possibly a bug just affecting the GP2X executable?
Title: Re: 3d on GP2X
Post by: Moru on 2009-Apr-20
I'm getting similar results, first frame shows up but then it gets dark. GP2X F100(B) firmware 3.0.0
Title: Re: 3d on GP2X
Post by: Kitty Hello on 2009-May-08
OK, bug is fixed in the current live-update. (Hopefully).
Title: Re: 3d on GP2X
Post by: snurty on 2009-May-30
Thanks Kitty Hello and it does appear fixed.