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 Previous  1, 2, 3, 4, 5, 6, 7, 8, 9
 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
sakya



Joined: 28 Apr 2006
Posts: 190

PostPosted: Tue Apr 15, 2008 8:07 pm    Post subject: Reply with quote

Hi! :)

Sorry for the double post....
Just to inform I released a modified version of OSLib (called OSLib MOD).
More info here:
http://www.sakya.it/forums/viewtopic.php?f=7&t=10

Changelog:
-Added: oslSetReadKeysFunction(int (*sceCtrlReadBufferPositive)(SceCtrlData *pad_data, int count));
You can pass to it a function from a kernel prx, so you'll be able to read all buttons (VOLUME_UP, NOTE...)
oslUnsetReadKeysFunction();
-Added: All USB.c functions now works
-Added: OSL_VERSION
-Added: oslSetHoldForAnalog
-Added: support for intraFont.
-Added: Dialogs (message, error and net conf)
-Added: On Screen Keyboard
-Added: Save and load
-Fixed: Tagged MP3 and ATRAC3+ now works
-Fixed: osl_keys->analogToDPadSensivity now works correctly

Download: http://www.sakya.it/OSLib_MOD/downloads/OSLib_MOD_1_0_0.rar
Source download: http://www.sakya.it/OSLib_MOD/downloads/OSLib_MOD_1_0_0_src.rar
Documentation: http://www.sakya.it/OSLib_MOD/doc/html

Ciaooo
Sakya


Last edited by sakya on Tue Apr 15, 2008 11:21 pm; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
Drakon



Joined: 08 Apr 2008
Posts: 13
Location: Poznan - Poland

PostPosted: Tue Apr 15, 2008 8:17 pm    Post subject: Reply with quote

Loooooooo nice man :> Thanks for sharing :)
Back to top
View user's profile Send private message Visit poster's website
BlackShark



Joined: 02 Mar 2007
Posts: 11

PostPosted: Tue Apr 15, 2008 11:53 pm    Post subject: Reply with quote

nice work, ill check it out now.
_________________
Programmer van der C
Back to top
View user's profile Send private message Visit poster's website
Sp3ct0r



Joined: 16 Apr 2008
Posts: 3

PostPosted: Wed Apr 16, 2008 9:02 am    Post subject: Reply with quote

Sweet! This is just what I needed. Thanks man! :D
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger
reefbarman



Joined: 08 Jan 2007
Posts: 87
Location: Australia

PostPosted: Tue Apr 22, 2008 4:56 pm    Post subject: Reply with quote

i love oslib and use it in most of my projects and this modified version jsut makes it so much better please keep up the good work, and keep the updates coming
Back to top
View user's profile Send private message
sakya



Joined: 28 Apr 2006
Posts: 190

PostPosted: Tue Apr 22, 2008 6:02 pm    Post subject: Reply with quote

Hi! :)
reefbarman wrote:
i love oslib and use it in most of my projects and this modified version jsut makes it so much better please keep up the good work, and keep the updates coming

Thanks.
I just released a bugfix version 1.0.1. ;)
More details here:
http://www.sakya.it/forums/viewtopic.php?f=7&t=13

Ciaooo
Sakya
Back to top
View user's profile Send private message Visit poster's website
reefbarman



Joined: 08 Jan 2007
Posts: 87
Location: Australia

PostPosted: Thu Apr 24, 2008 6:35 pm    Post subject: Reply with quote

sakya wrote:
Hi! :)
reefbarman wrote:
i love oslib and use it in most of my projects and this modified version jsut makes it so much better please keep up the good work, and keep the updates coming

Thanks.
I just released a bugfix version 1.0.1. ;)
More details here:
http://www.sakya.it/forums/viewtopic.php?f=7&t=13

Ciaooo
Sakya


hi i just tried your oslib_mod in my app that already contained the original oslib and just did a complete swap, but after doing so i got some really strange things happening in my app the app has a cursor that moved by itself around the screen where it shouldn't without user control, this doesn't happen with the standard oslib


what change were made to the original functions that may cause the side affects im seeing?

thanks
Back to top
View user's profile Send private message
sakya



Joined: 28 Apr 2006
Posts: 190

PostPosted: Fri Apr 25, 2008 9:47 pm    Post subject: Reply with quote

Hi! :)
reefbarman wrote:
i got some really strange things happening in my app the app has a cursor that moved by itself around the screen where it shouldn't without user control, this doesn't happen with the standard oslib

I don't know, I made some changes to controls but I don't have problems.
Can you post some code, please?

Ciaooo
Sakya
Back to top
View user's profile Send private message Visit poster's website
Alois2992



Joined: 22 Nov 2007
Posts: 7

PostPosted: Mon May 05, 2008 1:16 am    Post subject: OSLib and freetype Reply with quote

Hi,

I just tried to render text with OSLib, but the fonts that came with OSLib didn't satisfy me. So I decided to try freetype on OSLib. Now I've some results but it doesn't work very well. The capitals begin to flicker after some seconds and I can't find a reason for this strange behaviour.

Here some Code:
Code:

OSL_IMAGE* FontEngine::RenderString(std::string str, FE_Font* font, RenderColor color)
{
   if(!font->init)
   {
      //return new OSL_IMAGE;
   }
   OSL_IMAGE* img;
   std::vector<OSL_IMAGE*> Images;
   
   
   //FT_GlyphSlot slot = font->face->glyph; // a small shortcut   
   
   int pen_x = 0;
   //unsigned int n;
   
   for (unsigned int n = 0; n < str.length(); n++ )
   {
      FT_Load_Glyph( font->face, FT_Get_Char_Index( font->face, str.at(n) ), FT_LOAD_DEFAULT );
         //continue;

   
      FT_Glyph glyph;
          FT_Get_Glyph( font->face->glyph, &glyph );
      //   throw std::runtime_error("FT_Get_Glyph failed");

      //Convert the glyph to a bitmap.
      FT_Glyph_To_Bitmap( &glyph, ft_render_mode_normal, 0, 1 );
      FT_BitmapGlyph bitmap_glyph = (FT_BitmapGlyph)glyph;

      //This reference will make accessing the bitmap easier
      FT_Bitmap& bitmap=bitmap_glyph->bitmap;

      //Use our helper function to get the widths of
      //the bitmap data that we will need in order to create
      //our texture.
      int width = next_p2( bitmap.width );
      int height = next_p2( bitmap.rows );
   
      //Allocate memory for the texture data.
      img = oslCreateImage(width, height, OSL_IN_RAM, OSL_PF_8888);
      oslLockImage(img);
      //Here we fill in the data for the expanded bitmap.
      //Notice that we are using two channel bitmap (one for
      //luminocity and one for alpha), but we assign
      //both luminocity and alpha to the value that we
      //find in the FreeType bitmap.
      //We use the ?: operator so that value which we use
      //will be 0 if we are in the padding zone, and whatever
      //is the the Freetype bitmap otherwise.
      
      int *ptr = (int *)img->data;
      for(int j=0; j <height;j++)
      {
         for(int i=0; i < width; i++)
         {
            float alpha = (i>=bitmap.width || j>=bitmap.rows) ?
               0 : bitmap.buffer[i + bitmap.width*j];
            alpha /= 255 ;
            //fprintf(stderr, "%i ", int(alpha));
            *ptr++ = RGBA(color.col.r, color.col.g, color.col.b, int(color.col.a * alpha));
         }
         //fprintf(stderr, "\n");
      }// load glyph image into the slot (erase previous one)
      oslUnlockImage(img);
      //oslDrawImageXY(img, pen_x, 0);
      //pen_x += img->sizeX;
      Images.push_back(img);
         
   }
   img = NULL;
   int width = 0;
   int height = 0;
   for(unsigned int g = 0; g < Images.size(); g++)
   {
      width += Images[g]->sizeX;
      if(Images[g]->sizeY > height)
      {
         height = Images[g]->sizeY;
      }
      
   }
   //fprintf(stderr, "width: %i, height: %i\n", width, height);
   img = oslCreateImage(width, height, OSL_IN_VRAM, OSL_PF_8888);
   oslClearImage(img, RGBA(0, 0, 0, 0));
   oslSetAlphaWrite(OSL_FXAW_SET, 255, 0);
   //But do not draw transparent pixels (only those greater than 0).
   oslSetAlphaTest(OSL_FXAT_GREATER, 0);

   oslSetDrawBuffer(img);
   int posx = 0;
   for(unsigned int g = 0; g < Images.size(); g++)
   {
      oslDrawImageXY(Images[g], posx, 0);
      posx += Images[g]->sizeY;
      oslDeleteImage(Images[g]);
   }
   oslSetDrawBuffer(OSL_DEFAULT_BUFFER);
   oslMoveImageTo(   img, OSL_IN_RAM);
   return img;
}


I hope someone or maybe even brunni can help me, it's really important
_________________
Sorry for my bad English... I'm still learning
Back to top
View user's profile Send private message
Insert_witty_name



Joined: 10 May 2006
Posts: 376

PostPosted: Mon May 05, 2008 1:24 am    Post subject: Reply with quote

Using freetype at runtime like that is notoriously slow.

Hence why OSLib and other engines tend to use a bitmap font texture.
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 Previous  1, 2, 3, 4, 5, 6, 7, 8, 9
Page 9 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