| View previous topic :: View next topic |
| Author |
Message |
lego
Joined: 17 Oct 2008 Posts: 43
|
Posted: Fri Oct 30, 2009 1:04 am Post subject: pspgl & pspDebugScreenPrintf() |
|
|
Hi, all.
It's strange, but using pspgl I don't see pspDebugScreenPrintf() output on the screen or an output is very strange (big symbols, overlaped lines).
| Code: |
void initgl(void)
{
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0.0, 480, 272, 0, -1, 1);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glViewport(0, 0, 480, 272);
glClearColor(0.0, 0.0, 0.0, 0.0);
}
int main(void)
{
SDL_Surface *scrn;
SetupCallbacks();
pspDebugScreenInit();
if ( SDL_Init(SDL_INIT_VIDEO) ) {
fprintf(stderr, "Error: %s\n", SDL_GetError());
return 1;
}
atexit(SDL_Quit);
if ( !(scrn = SDL_SetVideoMode(480, 272, 32, SDL_OPENGL)) ) {
fprintf(stderr, "Set video Error: %s\n", SDL_GetError());
return 2;
}
initgl();
glClear(GL_COLOR_BUFFER_BIT);
printf("This message is displayed very very strange.");
sceKernelSleepThreadCB();
return 0;
}
|
|
|
| Back to top |
|
 |
Torch

Joined: 28 May 2008 Posts: 842
|
Posted: Fri Oct 30, 2009 1:50 am Post subject: |
|
|
| Debug blits to the active framebuffer. If the buffers have been swapped by something else (or display mode changed etc.), you need to reinit debug screen so it blits with the current display settings. |
|
| Back to top |
|
 |
lego
Joined: 17 Oct 2008 Posts: 43
|
Posted: Fri Oct 30, 2009 2:12 am Post subject: |
|
|
| Torch wrote: | | Debug blits to the active framebuffer. If the buffers have been swapped by something else (or display mode changed etc.), you need to reinit debug screen so it blits with the current display settings. |
Thanks! This works.
But how I can use smaller font? Text, which is too long for one line, overlap on the one line instead of printing on next lines. How can I resolve this issue? |
|
| Back to top |
|
 |
Torch

Joined: 28 May 2008 Posts: 842
|
Posted: Fri Oct 30, 2009 2:50 am Post subject: |
|
|
| lego wrote: | | But how I can use smaller font? Text, which is too long for one line, overlap on the one line instead of printing on next lines. How can I resolve this issue? |
You'll need to recompile it after creating a new "font" image with the size you require and editing the font width & height in the debug library source. The "font" file is just a RAW image that contains the ASCII characters. Try importing it as 8888 ARGB data in GIMP.
All the characters have a fixed width (8 pixels?). Just write a simple wrapper function to split it into multiple printf calls depending on the number of characters that fit (60 ?). |
|
| Back to top |
|
 |
lego
Joined: 17 Oct 2008 Posts: 43
|
Posted: Fri Oct 30, 2009 9:38 pm Post subject: |
|
|
| Torch wrote: | | lego wrote: | | But how I can use smaller font? Text, which is too long for one line, overlap on the one line instead of printing on next lines. How can I resolve this issue? |
You'll need to recompile it after creating a new "font" image with the size you require and editing the font width & height in the debug library source. The "font" file is just a RAW image that contains the ASCII characters. Try importing it as 8888 ARGB data in GIMP.
All the characters have a fixed width (8 pixels?). Just write a simple wrapper function to split it into multiple printf calls depending on the number of characters that fit (60 ?). |
Thanks. I will try to do this.
But why does sceDebugScreenPrintf() work fine with SDL and sceGu, claiming at the same time this manipulations with pspgl? |
|
| Back to top |
|
 |
lego
Joined: 17 Oct 2008 Posts: 43
|
Posted: Mon Nov 02, 2009 3:35 am Post subject: |
|
|
A problem with lines overlapping is resolved with:
| Code: |
pspDebugScreenSetMaxX(32);
pspDebugScreenSetMaxY(17);
|
This two functions available in the rev 2487 of the pspsdk.
But the problem with font stretching still remain. |
|
| Back to top |
|
 |
|