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 

[Interested?] OldSchool Library
Goto page 1, 2, 3, 4, 5, 6, 7, 8, 9  Next
 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
Brunni



Joined: 08 Oct 2005
Posts: 186

PostPosted: Mon Feb 13, 2006 1:16 am    Post subject: [Interested?] OldSchool Library Reply with quote

Hello all,
I'm working on a PSP library that allows you to create 2D games more easily, without having to learn PSP GE or GU. It's written in C, so it's useable in both C and C++.
For now there is an english and french documentation, but my english is not very good. I would just know if it interests somebody, so that I know if I should continue to work on it or not.
Here's an ALPHA version (this means it's still in development and some things might change): http://oslib.palib.info/OSLib.zip
Source: http://oslib.palib.info/OSLib_src.zip
It's now useable a bit. For example, you can play music and wav files, choose wether you want to stream it or not, load PNG files with an alpha channel, draw 4-point gradient rects, lines, text, message boxes, draw maps, rotate and stretch your images, make them transparent, draw on them by setting them as the current drawbuffer, mix differents pixelformats and so on very easily. It also includes a key handler, so you can get when a key was pressed or is currently held, set autorepeat values for some pressed keys. There are more features, and a lot of others are planned.
The library will be open source, LGPL or something so you can easily extend it. 3D is possible within the library context, but there's no integrated routine, you just have to use GU or GE in this case.
So, do you think it's useful, are some people interested that I continue to work on it?
Thank you in advance for your opinions :)
_________________
Sorry for my bad english
Oldschool library for PSP - PC version released


Last edited by Brunni on Thu Sep 14, 2006 6:29 am; edited 3 times in total
Back to top
View user's profile Send private message
Orion_



Joined: 27 Jan 2005
Posts: 69

PostPosted: Tue Feb 21, 2006 9:21 am    Post subject: Reply with quote

I just tried it and it's awesome ! it's exactly what I was looking for making 2D on psp :)
it work pretty well, fast, easy to use and install, is not as big as SDL and use psp hardware gpu, keep the great work !

(only a little bug on the install script, it forget to copy usb.h)
Back to top
View user's profile Send private message
MikeDX



Joined: 19 Oct 2005
Posts: 30

PostPosted: Tue Feb 21, 2006 11:46 am    Post subject: Reply with quote

hey that is very cool. tried it with devkitpro, worked as soon as i copied over usb.h

and as luck would have it, my 4gb hd just died :(
Back to top
View user's profile Send private message
pensoffsky



Joined: 13 Nov 2005
Posts: 8

PostPosted: Thu Mar 02, 2006 8:35 pm    Post subject: Reply with quote

hi,
i really like your library
do you know a way how to convert a sdl surface to something i can use with your functions?
i hope you are still working on this

pensoffsky
Back to top
View user's profile Send private message
Mollusk



Joined: 03 Mar 2006
Posts: 2

PostPosted: Fri Mar 03, 2006 12:46 am    Post subject: Reply with quote

Really great job !
Back to top
View user's profile Send private message
Brunni



Joined: 08 Oct 2005
Posts: 186

PostPosted: Fri Mar 03, 2006 6:27 pm    Post subject: Reply with quote

Thank you for your replies, it's good not to feel to have done all this for nothing :) (sorry for the frenglish xD)
I don't know anything about SDL, sorry. But there is for sure a mean to do that, the only thing would be to convert your surface info to an OSL_IMAGE structure. I'll take a look at it.
For now I'm still working on it, yes. When finished, I'll try to do some simple games or applications with it and release their source code on this forum if it can interest somebody.
_________________
Sorry for my bad english
Oldschool library for PSP - PC version released
Back to top
View user's profile Send private message
alain91



Joined: 01 Mar 2006
Posts: 13

PostPosted: Fri Mar 03, 2006 6:39 pm    Post subject: lib Reply with quote

Sympa ta lib :) vivement un site ?

je continue en franglais ;)

Will you add some 'sprite' functions into your lib ?
Will you add mod/x3m/.. playback ?

Regards,
Alain
Back to top
View user's profile Send private message
Orion_



Joined: 27 Jan 2005
Posts: 69

PostPosted: Fri Mar 03, 2006 10:16 pm    Post subject: Reply with quote

sprite function can easily be done, this is mine
Code:

void   DrawSprite(OSL_IMAGE *ig, u16 x, u16 y, u16 px, u16 py, u16 sx, u16 sy)
{
  ig->offsetX0 = px;
  ig->offsetY0 = py;
  ig->offsetX1 = px + sx;
  ig->offsetY1 = py + sy;
  ig->stretchX = sx;
  ig->stretchY = sy;
  ig->x = x;
  ig->y = y;
  oslDrawImageSimple(ig);
}

x,y = position on screen
px,py = sprite position in picture (if you have multiple sprite in same picture)
sx,sy = size of the sprite
Back to top
View user's profile Send private message
alain91



Joined: 01 Mar 2006
Posts: 13

PostPosted: Fri Mar 03, 2006 10:31 pm    Post subject: thanks Reply with quote

Thanks Orion_

Perhaps that some guys could co-operate to add more and more features to this lib ?..
Back to top
View user's profile Send private message
psx-frogger



Joined: 16 Jan 2006
Posts: 5

PostPosted: Sat Mar 04, 2006 9:19 pm    Post subject: Reply with quote

Hi Brunni,

thanks for your work.

Is it the same project as PALIB wich is developped for the Nintendo DS ?

regards

psx frogger


Last edited by psx-frogger on Tue Nov 21, 2006 6:52 am; edited 1 time in total
Back to top
View user's profile Send private message
Mollusk



Joined: 03 Mar 2006
Posts: 2

PostPosted: Sat Mar 04, 2006 9:23 pm    Post subject: Reply with quote

It's not the same project (though we now each other :p). I would say it's a similar kind of library, but for PSP... which seems way harder to do than on DS, by the way ^^
Back to top
View user's profile Send private message
Brunni



Joined: 08 Oct 2005
Posts: 186

PostPosted: Sun Mar 05, 2006 7:34 pm    Post subject: Reply with quote

Thank you for your replies. I'll try to traduce my doc in english then, because it seems to interest some people, but there's no warranty it will be enough to be understandable xD
It's Mollusk that programmed PALib, and he offered me some hosting for OSLib ^^
Mollusk > It seems harder because it's another world for you, but when you're in it, I wouldn't say it's really harder :-p
Orion_ > This could rather be done like this ;-)
Code:
void DrawSprite(OSL_IMAGE *ig, u16 x, u16 y, u16 px, u16 py, u16 sx, u16 sy)
{
  oslSetImageTileSize(ig, px, py, sx, sy);
  oslDrawImageSimpleXY(ig, x, y);
}

Alain> There's no module playback functions for now, but I note it, it might come later. For now I want to finish the library so I can release it ;-)
_________________
Sorry for my bad english
Oldschool library for PSP - PC version released
Back to top
View user's profile Send private message
Yodajr



Joined: 24 Sep 2005
Posts: 13

PostPosted: Sun Mar 05, 2006 11:20 pm    Post subject: Reply with quote

Brunni wrote:
Mollusk > It seems harder because it's another world for you, but when you're in it, I wouldn't say it's really harder :-p

I can confirm ! ;p
Back to top
View user's profile Send private message
Brunni



Joined: 08 Oct 2005
Posts: 186

PostPosted: Mon Mar 06, 2006 4:47 am    Post subject: Reply with quote

I released a new version with a first try of english documentation!
You can download the latest zip, and read Doc/english.htm inside :-)
_________________
Sorry for my bad english
Oldschool library for PSP - PC version released
Back to top
View user's profile Send private message
albator



Joined: 06 Mar 2006
Posts: 4

PostPosted: Mon Mar 06, 2006 8:47 am    Post subject: Reply with quote

Thanks for your great work.

in french:
Je débute avec la programmation sur psp et cette lib est vraiment l'idéal pour commencer à vrai dire j'ai hésiter entre SDL et OSLib, mais avec une doc bien faite et une simplicité d'utilisation certaine mon coeur à basculer vers ta superbe lib, continue sur ta lancée !
Back to top
View user's profile Send private message
Giuliano



Joined: 13 Sep 2005
Posts: 78

PostPosted: Mon Apr 17, 2006 1:18 pm    Post subject: Reply with quote

Anyone out there who is looking for an easy to use and fast 2d library, give Oslib a try. Just to give you an idea of how fast it is. I am able to draw about 400 16x16 tiles EVERY pass while still keeping 60FPS.

The library is easy to use and the documentation covers almost everything you need to know to get started.

There are a few bugs in it but hopefully Brunni will get them figured out soon enough. I have only found one and found a way to get around it.

If I ever get my game finished, I will release it to show the capabilities of this library.

Brunni, would it be possible to make a built in function to display a nice "Powered by OSLIB" logo?
Back to top
View user's profile Send private message
Brunni



Joined: 08 Oct 2005
Posts: 186

PostPosted: Mon Apr 17, 2006 6:56 pm    Post subject: Reply with quote

Thanks :)
How would you like something like this for the logo?
For PSP: http://oslib.palib.info/samples/download/logo_15.zip
For (powerful) PC: http://oslib.palib.info/logo.zip
_________________
Sorry for my bad english
Oldschool library for PSP - PC version released
Back to top
View user's profile Send private message
Giuliano



Joined: 13 Sep 2005
Posts: 78

PostPosted: Mon Apr 17, 2006 9:06 pm    Post subject: Reply with quote

Brunni wrote:
Thanks :)
How would you like something like this for the logo?
For PSP: http://oslib.palib.info/samples/download/logo_15.zip
For (powerful) PC: http://oslib.palib.info/logo.zip


That's fine but can it be like "Powered by Oldschool Library" (so people know it's the engine and don't think that it's the name of the game)
Back to top
View user's profile Send private message
danzel



Joined: 04 Nov 2005
Posts: 182

PostPosted: Mon Apr 17, 2006 11:10 pm    Post subject: Reply with quote

Wow, that was cool, it ran under cedega even.
Yeah, a 'powered by' or something would be good, but overall it is impressive :)
Back to top
View user's profile Send private message
TheHorst



Joined: 13 Apr 2006
Posts: 12

PostPosted: Wed Apr 19, 2006 9:08 pm    Post subject: Reply with quote

how can I change the font, used by the text console?
Back to top
View user's profile Send private message
Brunni



Joined: 08 Oct 2005
Posts: 186

PostPosted: Thu Apr 20, 2006 3:04 am    Post subject: Reply with quote

It's not documented yet, but you have to create one with font2osl.exe (included in the tools folder) and then oslLoadFontFile("yourfont").
You can also convert an existing Windows font (run font2osl.exe without parameter for more info).
_________________
Sorry for my bad english
Oldschool library for PSP - PC version released
Back to top
View user's profile Send private message
TheHorst



Joined: 13 Apr 2006
Posts: 12

PostPosted: Thu Apr 20, 2006 5:12 am    Post subject: Reply with quote

great, thx

i love this lib really ...

can u give me a hint how i can do alpha blending on a image?
didn´t got it yet ...

i will increase the transparency from 0 to 100%

im a noob and i know it :)
Back to top
View user's profile Send private message
TheHorst



Joined: 13 Apr 2006
Posts: 12

PostPosted: Thu Apr 20, 2006 10:18 pm    Post subject: Reply with quote

well ive tried loading my own font file, as well as the included verdana.oft, but i don´t know but its displaying them wrong ... seems, that it doesn´t adjust the char width ...
Back to top
View user's profile Send private message
Brunni



Joined: 08 Oct 2005
Posts: 186

PostPosted: Thu Apr 20, 2006 11:33 pm    Post subject: Reply with quote

Transparency: oslSetAlpha with OSL_FX_ALPHA
Font: I used Verdana in my first demo, and it worked. Maybe I have broken something, I'll test it ^^
_________________
Sorry for my bad english
Oldschool library for PSP - PC version released
Back to top
View user's profile Send private message
TheHorst



Joined: 13 Apr 2006
Posts: 12

PostPosted: Fri Apr 21, 2006 6:38 am    Post subject: Reply with quote

can u advice me a little more?
thats my code:

oslDrawImage(tmpimage);
oslSetAlpha(OSL_FX_ALPHA, what has to be here to make it 50% transparent);
oslSyncFrame();

thx for evrything ...
Back to top
View user's profile Send private message
Yodajr



Joined: 24 Sep 2005
Posts: 13

PostPosted: Fri Apr 21, 2006 7:39 am    Post subject: Reply with quote

Code:
//transparency
oslSetAlpha(OSL_FX_ALPHA,alpha);

oslDrawImage(image);

//desactive transparency
oslSetAlpha(OSL_FX_RGBA,alpha);


With "alpha" goes from 0 to 255
Back to top
View user's profile Send private message
TheHorst



Joined: 13 Apr 2006
Posts: 12

PostPosted: Fri Apr 21, 2006 3:28 pm    Post subject: Reply with quote

Yodajr wrote:
Code:
//transparency
oslSetAlpha(OSL_FX_ALPHA,alpha);

oslDrawImage(image);

//desactive transparency
oslSetAlpha(OSL_FX_RGBA,alpha);


With "alpha" goes from 0 to 255


well thats what i´ve tried ... doesn´t has any effect on the image ...
Back to top
View user's profile Send private message
Yodajr



Joined: 24 Sep 2005
Posts: 13

PostPosted: Fri Apr 21, 2006 4:37 pm    Post subject: Reply with quote

TheHorst wrote:

well thats what i´ve tried ... doesn´t has any effect on the image ...

Are you sure ? 'cause this code works, try to download again the last version of oslib and retry...
_________________
Tutorials about OSLib here
Back to top
View user's profile Send private message
TheHorst



Joined: 13 Apr 2006
Posts: 12

PostPosted: Sun Apr 23, 2006 4:42 am    Post subject: Reply with quote

thanks solved it ... needs to have 2 components to work ... BG image and image you wana bland ... tried it without background that was te prob ...
Back to top
View user's profile Send private message
monkey242



Joined: 25 Apr 2006
Posts: 3

PostPosted: Tue Apr 25, 2006 4:30 am    Post subject: Reply with quote

I'm fairly new to programming for the PSP so forgive me if this is really simple stuff. I'm trying to use oslib to do some C++ programming and I've hit a few snags.

First, on line 60 of oslib.h you typedef a bool as a short. g++ complains that you can't redefine bool so I just put an #ifndef __cplusplus around that line. Is that correct or will it break something else?

Assuming that it was correct to not include that line, the second thing is that I'm getting multiple definitions of 'osl_powerCallback' in 'oslSetupFTrigo' while linking. This then breaks every oslib function that appears in my code.

My code (just a little test stub at the moment) compiles when I change the extension from .cpp to .c and remove -lstdc++ from the makefile.

Does anyone know where I'm going wrong?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Goto page 1, 2, 3, 4, 5, 6, 7, 8, 9  Next
Page 1 of 9

 
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