PSPGL errors?
-
- Posts: 42
- Joined: Sat Nov 12, 2005 2:30 am
PSPGL errors?
Alright just for fun, im trying to port an application to the PSP and im getting the following errors:
undefined reference to 'gluOrtho2D'
undefined reference to 'glVertex2s'
undefined reference to 'gluGetString'
as well as others.
Now I know they are all coming from PSPGL, does PSPGL support those functions and if so, what should the first location I should go to, to help solve those issues?
undefined reference to 'gluOrtho2D'
undefined reference to 'glVertex2s'
undefined reference to 'gluGetString'
as well as others.
Now I know they are all coming from PSPGL, does PSPGL support those functions and if so, what should the first location I should go to, to help solve those issues?
-
- Posts: 12
- Joined: Thu Oct 04, 2007 12:33 am
hello
Sorry for my language,i am French ^^
I have a problem me too !
see my screen:
After modify with gluOrtho2D see :
This is my code:
Sorry for my language,i am French ^^
I have a problem me too !
see my screen:
After modify with gluOrtho2D see :
This is my code:
Code: Select all
#include <GL/glut.h> // Header File For The GLUT Library
#include <GL/gl.h> // Header File For The OpenGL32 Library
#include <GL/glu.h> // Header File For The GLu32 Library
//#include <unistd.h> // Header file for sleeping. @@@
#include <stdio.h> // Header file for standard file i/o.
#include <stdlib.h> // Header file for malloc/free.
#include <math.h> // Header file for trigonometric functions.
#include <SDL/SDL.h>
#include <SDL/SDL_image.h>
#include <pspuser.h>
#include <pspctrl.h>
//#include <unistd.h> // Header file for sleeping. @@@
#define LARGEUR_BASE 50
#define HAUTEUR_BASE 20
#define LARGEUR_BRAS_1 150
#define HAUTEUR_BRAS_1 15
#define LARGEUR_BRAS_2 50
#define HAUTEUR_BRAS_2 10
#define TAILLE_CAISSE 10
#define LARGEUR_ECRAN 480
#define HAUTEUR_ECRAN 272
int angle1 = 45;
int angle2 = -20;
int longueur = 50;
PSP_MODULE_INFO("Alban", 0x0, 1, 1);
PSP_MAIN_THREAD_ATTR(0);
void Dessiner();
int main(int argc, char *argv[])
{
SDL_Init(SDL_INIT_VIDEO);
atexit(SDL_Quit);
SDL_SetVideoMode(LARGEUR_ECRAN, HAUTEUR_ECRAN, 32, SDL_OPENGL);
glMatrixMode( GL_PROJECTION );
glLoadIdentity( );
gluOrtho2D(0,LARGEUR_ECRAN,0,HAUTEUR_ECRAN);
int continuer = 1;
Dessiner();
int angle;
SceCtrlData pad;
while(continuer)
{
sceCtrlReadBufferPositive(&pad, 1);
switch (pad.Buttons)
{
case PSP_CTRL_UP :
longueur --;
if (longueur < 10)
longueur = 10;
break;
case PSP_CTRL_DOWN:
longueur ++;
if (longueur > 100)
longueur = 100;
break;
case PSP_CTRL_LEFT:
if (angle==1)
{
angle1++;
if (angle1 > 90)
angle1 = 90;
}
else
{
angle2++;
}
break;
case PSP_CTRL_RIGHT:
if (angle==1)
{
angle1--;
if (angle1 < 10)
angle1 = 10;
}
else
{
angle2--;
if (angle2 < -90)
angle2 = -90;
}
break;
case PSP_CTRL_RTRIGGER:
angle = 1;
break;
}
Dessiner();
}
return 0;
}
/*
Dessine un rectangle avec comme point de reférence
le milieu du coté gauche
*/
void dessineRectangle(double largeur,double hauteur)
{
glBegin(GL_QUADS);
glVertex2d(0,-hauteur/2);
glVertex2d(0,hauteur/2);
glVertex2d(largeur,hauteur/2);
glVertex2d(largeur,-hauteur/2);
glEnd();
}
/*
Dessine le repère actuel pour faciliter
la compréhension des transformations.
Utiliser "echelle" pour avoir un repère bien orienté et positionné
mais avec une échelle différente.
*/
void dessinerRepere(unsigned int echelle = 1)
{
glPushMatrix();
glScaled(echelle,echelle,echelle);
glBegin(GL_LINES);
glColor3ub(0,0,255);
glVertex2i(0,0);
glVertex2i(1,0);
glColor3ub(0,255,0);
glVertex2i(0,0);
glVertex2i(0,1);
glEnd();
glPopMatrix();
}
void Dessiner()
{
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
glMatrixMode( GL_MODELVIEW );
glLoadIdentity( );
/* Je déplace mon répère initial (actuellement
en bas à gauche de l'écran) */
glTranslatef(LARGEUR_BASE/2,HAUTEUR_BASE,0);
// La base
glColor3ub(254,128,1);
dessineRectangle(LARGEUR_BASE,HAUTEUR_BASE);
//Je me place en haut au milieu de la base
glTranslatef(LARGEUR_BASE/2,HAUTEUR_BASE/2,0);
// Le grand bras
glRotatef(angle1,0,0,1);
glColor3ub(248,230,7);
dessineRectangle(LARGEUR_BRAS_1,HAUTEUR_BRAS_1);
// Je me place au bout du grand bras
glTranslatef(LARGEUR_BRAS_1,0,0);
// Puis m'occupe du petit bras
glRotatef(angle2,0,0,1);
glColor3ub(186,234,21);
dessineRectangle(LARGEUR_BRAS_2,HAUTEUR_BRAS_2);
// Je me place au bout du petit bras
glTranslatef(LARGEUR_BRAS_2,0,0);
/* J'annule les rotations pour avoir mon repère aligné
avec le repère d'origine */
glRotatef(-angle1-angle2,0,0,1);
// Je dessine le fil
glColor3ub(255,255,255);
glBegin(GL_LINES);
glVertex2i(0,0);
glVertex2i(0,-longueur);
glEnd();
/* Je descends en bas du fil (avec un petit décalage
sur X pour anticiper le dessin de la caisse */
glTranslatef(-TAILLE_CAISSE/2,-longueur,0);
// Et je dessine enfin la caisse
glColor3ub(175,175,85);
dessineRectangle(TAILLE_CAISSE,TAILLE_CAISSE);
glFlush();
SDL_GL_SwapBuffers();
}
-
- Posts: 12
- Joined: Thu Oct 04, 2007 12:33 am
Ok thank's
But i put
And == no compile xD
see:
After i put
and == no compile
see:
Help me please ^^
Thanks you
(Sorry for my language, i am french and i have 14 years old ) i write a little english
But i put
Code: Select all
glOrtho(0,LARGEUR_ECRAN,0,HAUTEUR_ECRAN);
see:
After i put
Code: Select all
glOrtho(0,LARGEUR_ECRAN,0,HAUTEUR_ECRAN,0,0);
see:
Help me please ^^
Thanks you
(Sorry for my language, i am french and i have 14 years old ) i write a little english
french:
pour que ce soit clair
l'erreur ne vient pas de ton code mais du linkage c'est a dire qu'il te dit qu'il ne trouve pas dans les librairies la fonction "sceRtc.." donc il faut que tu ajoutes la bonne librairies surement "-lpsprtc"
the error is not in the code but in the linkage ...
you need to add the rtc lib : -lpsprtc
pour que ce soit clair
l'erreur ne vient pas de ton code mais du linkage c'est a dire qu'il te dit qu'il ne trouve pas dans les librairies la fonction "sceRtc.." donc il faut que tu ajoutes la bonne librairies surement "-lpsprtc"
the error is not in the code but in the linkage ...
you need to add the rtc lib : -lpsprtc
-
- Posts: 12
- Joined: Thu Oct 04, 2007 12:33 am
Your code isn't set to use the vfpu. You need.::Albandu51::. wrote:Thank's you !
The code compile ^^ but not fonction on psp ( screen black + freeze ) xD
Code: Select all
PSP_MAIN_THREAD_ATTR(PSP_THREAD_ATTR_VFPU | PSP_THREAD_ATTR_USER);
-
- Posts: 42
- Joined: Sat Nov 12, 2005 2:30 am
ok....
Alright, thanks for the advice so far. I have either just removed the trouble code or converted it to what works. Just a few questions:
I am still getting errors with the following OpenGL commands.
glPixelMapfv
gluOrtho2D
glPixelTransferi
alright any suggestions about those? I know you said that gluOrtho2D can be subbed for gluOrtho with some modifying and I did see some samples on how to try that. Are the other two commands supported by PSPGL?
Thanks!
I am still getting errors with the following OpenGL commands.
glPixelMapfv
gluOrtho2D
glPixelTransferi
alright any suggestions about those? I know you said that gluOrtho2D can be subbed for gluOrtho with some modifying and I did see some samples on how to try that. Are the other two commands supported by PSPGL?
Thanks!