Google

OgreMagic Library[ Ver 1.50 released - irrlicht integrated]

A place to show off your latest screenshots and for people to comment on them. Only start a new thread here if you have some nice images to show off!

Moderators: Moderators, OGRE Team

OgreMagic Library[ Ver 1.50 released - irrlicht integrated]

Postby Emil_halim » Fri Nov 10, 2006 9:26 am

Hi everybody

Here is a very early beta version of Magic Library for Ogre, the sources is released for the sake of contribution only , i.e. it is for testing and giving a recommendations and advises.

It may has many bugs and still not optimized yet.

Any comments or suggestions are welcome

If you are interesting , here is a link to Irrlicht version of Magic Library.
http://www.freewebs.com/bcxgl/screenshots1.htm

Here a screenshot of cycle fading of Ogre Image
Image

And here is the code
Code: Select all
/***************************************************************************

                     Magic Library For Ogre
                       beta version 0.01
                         by Emil Halim

    CopyRight: this product is a CopyRight to Emil Halim,
               It is released for testing purpose only.

/***************************************************************************/



Edited:

i have removed the source code.

Edited 25/11/2006

Hi Everybody

Here is the first Version 0.01 of Magic Library For Ogre 3D Engine.

Download:
http://bcxdx.spoilerspace.com/Ogre/MagicDxLibrary0.01.zip

Here is the a ScreenShot of MagicDemo
Image
Last edited by Emil_halim on Sun Apr 18, 2010 4:19 pm, edited 13 times in total.
User avatar
Emil_halim
Veteran
 
Posts: 321
Joined: Fri Oct 27, 2006 8:56 am
Location: Alex, Egypt

Postby Frenetic » Fri Nov 10, 2006 12:06 pm

This belongs in the wiki, not the forums. Please link to the wiki page from your original post, and edit it to remove all that code. :P
User avatar
Frenetic
Veteran
 
Posts: 806
Joined: Fri Feb 03, 2006 7:08 am

Postby Emil_halim » Fri Nov 10, 2006 12:18 pm

I think that , while it is under construction , so it may be heavily changes ,and some times I need some help to complete it , so that posting it to the wiki in this stage is correct choice.

May be it is wrong forum that I posted in , but did not know which one should I use.

So what do you think ? :)
User avatar
Emil_halim
Veteran
 
Posts: 321
Joined: Fri Oct 27, 2006 8:56 am
Location: Alex, Egypt

Postby steven » Fri Nov 10, 2006 12:55 pm

Code: Select all
    CopyRight: this product is a CopyRight to Emil Halim,
               It is released for testing purpose only.


Mhh.... I could be mistaken but I thought that all the source code on the ogre wiki is "public domain".
See the disclaimer at the base of the main wiki page:

Source code is public domain, other content is available under GNU Free Documentation License 1.2.

Wouldn't your license be in conflict if you post on the wiki ?

PS: I hate legalities hence I am a bit parnoid ;)
Last edited by steven on Fri Nov 10, 2006 1:43 pm, edited 1 time in total.
User avatar
steven
Veteran
 
Posts: 652
Joined: Mon Feb 28, 2005 1:53 pm
Location: Australia - Canberra (ex - Switzerland - Geneva)

Postby nebukadnezzar » Fri Nov 10, 2006 1:20 pm

steven wrote:
Code: Select all
    CopyRight: this product is a CopyRight to Emil Halim,
               It is released for testing purpose only.


Mhh.... I could be mistaken but I thought that all the source code on the ogre wiki is "public domain".
See the disclaimer at the base of the main wiki page:

Source code is public domain, other content is available under GNU Free Documentation License 1.2.

Wouldn't your license be in conflict if you post on the wiki ?

PS: I hate legalities hence I am a bit parnoid ;)


I would say already posting the code on the forums makes it public domain....
User avatar
nebukadnezzar
Regular
 
Posts: 93
Joined: Sun Jun 11, 2006 4:40 pm
Location: Germany

Postby stodge » Fri Nov 10, 2006 1:34 pm

"Iwould say already posting the code on the forums makes it public domain...."

Unless you specifically include a license in the code or post perhaps?
What does the debugger tell you? You *are* using a debugger, right??
stodge
Veteran
 
Posts: 422
Joined: Thu Oct 24, 2002 4:12 am

Postby Emil_halim » Fri Nov 10, 2006 2:42 pm

Ok , this may make the picture more clear , the final Magic Library project will only contain a DLL and the headers and the libs and some examples.

So the point of releasing this code is to show you how it internally will be ,so if you think there is an other more optimized and enhanced approach you code tell me.

So the a license in this case is not important.

Hope it is clear by now.
User avatar
Emil_halim
Veteran
 
Posts: 321
Joined: Fri Oct 27, 2006 8:56 am
Location: Alex, Egypt

Postby Game_Ender » Fri Nov 10, 2006 4:34 pm

So you are releasing only the source to this version, and then once you have gotten advice on how to improve it you will just release binaries?
User avatar
Game_Ender
Veteran
 
Posts: 1268
Joined: Wed May 25, 2005 2:31 am
Location: Rockville, MD, USA

Postby Emil_halim » Fri Nov 10, 2006 4:52 pm

Yes , and if any one want to keep contribute , I can share the sources with him .

An other thing , if you take a closer look for Irrlicht one you will see that , although it is closed sources but there are more than 100 examples with their open sources to show you how to make many effects.
User avatar
Emil_halim
Veteran
 
Posts: 321
Joined: Fri Oct 27, 2006 8:56 am
Location: Alex, Egypt

You have made my day!

Postby irrdev » Sat Nov 11, 2006 7:06 am

@Emil_halim:
You have made my day! :lol: I was using Magic Library in Irrlicht, and when I switched to Ogre, I really began missing it! I am going to start "testing" the class right now in my app. It is great to see it ported to Ogre. Do you plan to keep the same member function names, classes, and such? I hope you do. Anyways, great work! I can't wait for the official binary release! :lol:
FeedLaunch .NET RSS and ATOM feed editor- open-source and released under the GPL. Visit Feed Launch .NET Project Website hosted at sourceforge.net
User avatar
irrdev
Veteran
 
Posts: 420
Joined: Sun Oct 15, 2006 7:30 pm

Re: You have made my day!

Postby Emil_halim » Sat Nov 11, 2006 9:02 am

irrdev wrote: Do you plan to keep the same member function names, classes, and such? I hope you do. Anyways, great work! I can't wait for the official binary release! :lol:


I am afraid no, because Ogre differs from Irrlicht , but if you want the old names there is a trick that you can do , use a macro to rename them , i.e. #define OldName NewName .
User avatar
Emil_halim
Veteran
 
Posts: 321
Joined: Fri Oct 27, 2006 8:56 am
Location: Alex, Egypt

...

Postby irrdev » Sat Nov 11, 2006 9:13 am

I'm sorry to hear that the functions calls will be different, but it is understandable. Good tip about the #define Oldname Newname, I haven't ever thought of using that! :lol:
FeedLaunch .NET RSS and ATOM feed editor- open-source and released under the GPL. Visit Feed Launch .NET Project Website hosted at sourceforge.net
User avatar
irrdev
Veteran
 
Posts: 420
Joined: Sun Oct 15, 2006 7:30 pm

Postby JonasBS » Sun Nov 12, 2006 2:23 am

Why is the rendering window header so Different to what I know :wink: ??
JonasBS
Newcomer
 
Posts: 21
Joined: Wed Apr 27, 2005 1:43 pm

Postby nikki » Sun Nov 12, 2006 6:34 am

JonasBS wrote:Why is the rendering window header so Different to what I know :wink: ??

He used a different theme from the usual one. :)
User avatar
nikki
Veteran
 
Posts: 2654
Joined: Sat Sep 17, 2005 10:08 am
Location: Doha, Qatar.

Postby Emil_halim » Sun Nov 12, 2006 12:42 pm

Ok , after doing some benchmark and test speed to make comparison between Oger version and Irrlicht version , I decided that , I will not work with HardWarebuffer and do all darwing stuff with pure DirectX and OpenGl , and keep setting render states by using Ogre RenderSystem.
User avatar
Emil_halim
Veteran
 
Posts: 321
Joined: Fri Oct 27, 2006 8:56 am
Location: Alex, Egypt

Postby Vectrex » Sun Nov 12, 2006 1:02 pm

interesting..
I found some spelling mistakes
BLINDTYPE = BLENDTYPE?
Distroy = Destroy

These aren't mistakes but it'd be nice to avoid unnessesary abbreviations and weird names :)
mScrnWidth
mZZRotate
User avatar
Vectrex
Veteran
 
Posts: 1352
Joined: Tue Aug 12, 2003 1:53 am
Location: Melbourne, Australia

Postby Emil_halim » Sun Nov 12, 2006 1:26 pm

thanks Vectrex,

:oops: i will correct them soon.
User avatar
Emil_halim
Veteran
 
Posts: 321
Joined: Fri Oct 27, 2006 8:56 am
Location: Alex, Egypt

Postby Emil_halim » Sun Nov 12, 2006 6:16 pm

ok , I have add a new function ‘ DrawImageToFitArea ‘ which allow you to fit the size of our image to a specific dimension on the screen.

This version will work only with Directx render system , I will make an other one for OpenGl soon.

hrer is a screenshot

Image
User avatar
Emil_halim
Veteran
 
Posts: 321
Joined: Fri Oct 27, 2006 8:56 am
Location: Alex, Egypt

Postby Emil_halim » Sun Nov 12, 2006 11:11 pm

Hi EveryBody

Here is what I have implemented with MagicLibrary So far , of course there are still many functions that I will do.

Prototype of MagicDXManager Class
Code: Select all
enum BLENDTYPE
  {
    SOLIDBLEND = 1,
    ALPHABLEND,
    LIGHTBLEND
  };

  enum POINTORDER
   {
       TopLeft = 1,
       TopRight,
       BottomLeft,
       BottomRight,
       AllPoints
   };

  struct ImageData
   {
       TexturePtr tp;
       float  halfWidth;
       float  halfHeight;
   };

typedef unsigned long ULONG ;

class MagicDXManager : public Ogre::Singleton<MagicDXManager>
{
    private:
        LPDIRECT3DDEVICE9   DX9Device;
        Ogre::RenderWindow* mWindow;
        Ogre::RenderSystem* rs;
        Ogre::Viewport*     mvp;
        Ogre::Camera*       mCamera;
        Ogre::Matrix4       OrthoMat;
        Ogre::Matrix4       ProjMat;
        Ogre::LayerBlendModeEx colorBlendMode;
        Ogre::LayerBlendModeEx alphaBlendMode;
        Ogre::TextureUnitState::UVWAddressingMode uvwAddressMode;
        bool  Initialized;
        // save render states
        Ogre::CullingMode CullState;

        //color and alpha
        uchar  alpha1,alpha2,alpha3,alpha4;
        uchar  red1,red2,red3,red4;
        uchar  green1,green2,green3,green4;
        uchar  blue1,blue2,blue3,blue4;
        // transformation
        float mRotate;
        float mScaleX,mScaleY;
        bool  mHorizontalFlip,mVerticalFlip;
        float mScreenWidth,mScreenHeight;
        float mhalfScreenWidth,mhalfScreenHeight;
        // fade variables
        struct FadeData
         {
             float   factor;
             ULONG   oldtick;
             ULONG   flag;
         };
        FadeData mFadeData[64];

    public:
        static MagicDXManager* getSingletonPtr(void);
        static MagicDXManager& getSingleton(void);
        MagicDXManager();
       ~MagicDXManager();
        void  Initialize(RenderWindow* mWin,Camera*  mCam);
        void  Destroy();
        float GetScreenWidth();
        float GetScreenHeight();
        float GetHalfScreenWidth();
        float GetHalfScreenHeight();
        void  UseOrthogonalView();
        void  UsePerspectiveView();
        void  SetBlendMode(BLENDTYPE bm);
        void  SetColor(uchar r,uchar g,uchar b,POINTORDER po = AllPoints);
        void  SetAlpha(float a,POINTORDER po = AllPoints);
        void  SetScale(float Sx,float Sy);
        void  SetRotation(float Rot);
        void  SetHorizontalFlip(bool flag);
        void  SetVerticalFlip(bool flag);
        void  FadeIn(float  time,int FadeID);
        void  FadeOut(float  time,int FadeID);
        void  FadeInOut(float in,ULONG sty,float out,int FadeID);
        void  CycleFadeInOut(float in,ULONG sty,float out,int FadeID);
        float GetFadeFactor(int FadeID);
        void  SetFadeFactor(float f,int FadeID);
        ImageData* LoadStaticImage(const String &name, const String &group);
        void  SetImageColorKey(ImageData* image,ULONG color);
        void  SetImageColorKeyFromPoint(ImageData* image,int x, int y);
        void  SetImageTexture(ImageData* image);
        void  DrawImage(ImageData* image,float mTransX,float mTransY);
        void  DrawImageToFitArea(ImageData* image,float Left,float Top,float Width,float Height);
        void  DrawPartOfImage(ImageData* image,float mTransX,float mTransY,float Left,float Top,float Width,float Height);

};
User avatar
Emil_halim
Veteran
 
Posts: 321
Joined: Fri Oct 27, 2006 8:56 am
Location: Alex, Egypt

Postby Game_Ender » Mon Nov 13, 2006 2:18 am

Why don't you put this stuff on the Wiki?
User avatar
Game_Ender
Veteran
 
Posts: 1268
Joined: Wed May 25, 2005 2:31 am
Location: Rockville, MD, USA

Postby Virion » Mon Nov 13, 2006 4:01 am

maybe you can just list out the name of the functions and their uses in the forum, and post the codes in the wiki?
User avatar
Virion
Regular
 
Posts: 78
Joined: Mon Jul 24, 2006 11:06 am
Location: Malaysia

Postby Emil_halim » Mon Nov 13, 2006 9:12 am

Game_Ender wrote:Why don't you put this stuff on the Wiki?

I am just little confused , where should I make My MagicLibrary page in the wiki , which page the suitable for this category.

Any help please ?


maybe you can just list out the name of the functions and their uses in the forum, and post the codes in the wiki?


I am afraid , I am not willing , and it is a closed source project.
User avatar
Emil_halim
Veteran
 
Posts: 321
Joined: Fri Oct 27, 2006 8:56 am
Location: Alex, Egypt

Postby Vectrex » Mon Nov 13, 2006 12:39 pm

you could update your first post with the latest code/headers and add a 'edit' + date type thing
User avatar
Vectrex
Veteran
 
Posts: 1352
Joined: Tue Aug 12, 2003 1:53 am
Location: Melbourne, Australia

Postby elesgal » Mon Nov 13, 2006 2:01 pm

Emil_halim wrote:I am afraid , I am not willing , and it is a closed source project.


btw what is so special in it that it is a closed source project?
User avatar
elesgal
Newcomer
 
Posts: 24
Joined: Thu Sep 29, 2005 4:23 pm
Location: Slovak Republic

Postby Emil_halim » Mon Nov 13, 2006 2:53 pm

Mr elesgal

It is closed project not because there is something that SO SPECIAL in it , but it is my own desire , besides the drawing stuff is not rely on Oger .
User avatar
Emil_halim
Veteran
 
Posts: 321
Joined: Fri Oct 27, 2006 8:56 am
Location: Alex, Egypt

Next

Return to Showcase

Who is online

Users browsing this forum: GenesisRage, KungFooMasta and 2 guests