forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problem with gslib

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development
View previous topic :: View next topic  
Author Message
BiB



Joined: 27 Feb 2004
Posts: 36
Location: France

PostPosted: Tue Aug 31, 2004 11:55 pm    Post subject: Problem with gslib Reply with quote

I am making a little sample using GsLib and i have a problem.

First, I declare a gsDriver object :
Code:

gsDriver GS;


but when i want to do something with it, the prog hangs.

For example :
Code:

GS.setDisplayMode(.......);




I saw that when i put the declaration inside a function, it works.

But i want to use the same gsDriver in many functions. How can I do it ?

It seems that the gsDriver is not correctly if defined outside a function.

Any idea is welocme :wink:
Back to top
View user's profile Send private message
t0mb0la



Joined: 20 Jan 2004
Posts: 24
Location: Seattle WA, USA

PostPosted: Wed Sep 01, 2004 4:40 am    Post subject: Reply with quote

Just a guess, but perhaps you need to call _init at the start of your main.

Code:
extern "C" { void _init(void); }

int main(int argc, char **argv)
{
 _init();
 .
 .
 .
}
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
BiB



Joined: 27 Feb 2004
Posts: 36
Location: France

PostPosted: Wed Sep 01, 2004 7:07 am    Post subject: Reply with quote

I saw that you did that for altimit but i don't understand this thing.

Can you explain me what this call does ?

Thanks
Back to top
View user's profile Send private message
MrSiir[S]



Joined: 14 Sep 2004
Posts: 32

PostPosted: Wed Sep 15, 2004 11:30 am    Post subject: Re: Problem with gslib Reply with quote

BiB wrote:
I saw that when i put the declaration inside a function, it works.
But i want to use the same gsDriver in many functions. How can I do it ?
It seems that the gsDriver is not correctly if defined outside a function.
Any idea is welocme :wink:

Test this:
Code:

// outside functions (global var)
gsDriver* myGsDriver;

// in main
int main()
{
   myGsDriver = new gsDriver;
   myGsDriver->setDisplayMode(
   ....
}

// In other function
void foo()
{
   myGsDriver->drawPipe.RectFlat(0,0,100,100,0,black);
}
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group