OgreMagic Library[** MagicPro Ver 0.5 released **]

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!
Post Reply
User avatar
Emil_halim
Gnome
Posts: 337
Joined: Fri Oct 27, 2006 8:56 am
Location: Alex, Egypt
x 1
Contact:

OgreMagic Library[** MagicPro Ver 0.5 released **]

Post by Emil_halim »

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/Magi ... ry0.01.zip

Here is the a ScreenShot of MagicDemo
Image
Last edited by Emil_halim on Tue Jul 21, 2015 12:05 am, edited 14 times in total.
User avatar
Frenetic
Bugbear
Posts: 806
Joined: Fri Feb 03, 2006 7:08 am

Post by Frenetic »

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
Emil_halim
Gnome
Posts: 337
Joined: Fri Oct 27, 2006 8:56 am
Location: Alex, Egypt
x 1
Contact:

Post by Emil_halim »

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
steven
Gnoll
Posts: 657
Joined: Mon Feb 28, 2005 1:53 pm
Location: Australia - Canberra (ex - Switzerland - Geneva)
Contact:

Post by steven »

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
nebukadnezzar
Halfling
Posts: 93
Joined: Sun Jun 11, 2006 4:40 pm
Location: Germany
x 1
Contact:

Post by nebukadnezzar »

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....
stodge
Goblin
Posts: 217
Joined: Thu Oct 24, 2002 4:12 am
x 1
Contact:

Post by stodge »

"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??
User avatar
Emil_halim
Gnome
Posts: 337
Joined: Fri Oct 27, 2006 8:56 am
Location: Alex, Egypt
x 1
Contact:

Post by Emil_halim »

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
Game_Ender
Ogre Magi
Posts: 1269
Joined: Wed May 25, 2005 2:31 am
Location: Rockville, MD, USA

Post by Game_Ender »

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
Emil_halim
Gnome
Posts: 337
Joined: Fri Oct 27, 2006 8:56 am
Location: Alex, Egypt
x 1
Contact:

Post by Emil_halim »

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
irrdev
Orc
Posts: 420
Joined: Sun Oct 15, 2006 7:30 pm
Contact:

You have made my day!

Post by irrdev »

@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
Emil_halim
Gnome
Posts: 337
Joined: Fri Oct 27, 2006 8:56 am
Location: Alex, Egypt
x 1
Contact:

Re: You have made my day!

Post by Emil_halim »

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
irrdev
Orc
Posts: 420
Joined: Sun Oct 15, 2006 7:30 pm
Contact:

...

Post by irrdev »

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
JonasBS
Gnoblar
Posts: 21
Joined: Wed Apr 27, 2005 1:43 pm

Post by JonasBS »

Why is the rendering window header so Different to what I know :wink: ??
User avatar
nikki
Old One
Posts: 2730
Joined: Sat Sep 17, 2005 10:08 am
Location: San Francisco
x 13
Contact:

Post by nikki »

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
Emil_halim
Gnome
Posts: 337
Joined: Fri Oct 27, 2006 8:56 am
Location: Alex, Egypt
x 1
Contact:

Post by Emil_halim »

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.
Vectrex
Ogre Magi
Posts: 1266
Joined: Tue Aug 12, 2003 1:53 am
Location: Melbourne, Australia
x 1
Contact:

Post by Vectrex »

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
Emil_halim
Gnome
Posts: 337
Joined: Fri Oct 27, 2006 8:56 am
Location: Alex, Egypt
x 1
Contact:

Post by Emil_halim »

thanks Vectrex,

:oops: i will correct them soon.
User avatar
Emil_halim
Gnome
Posts: 337
Joined: Fri Oct 27, 2006 8:56 am
Location: Alex, Egypt
x 1
Contact:

Post by Emil_halim »

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
Gnome
Posts: 337
Joined: Fri Oct 27, 2006 8:56 am
Location: Alex, Egypt
x 1
Contact:

Post by Emil_halim »

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
Game_Ender
Ogre Magi
Posts: 1269
Joined: Wed May 25, 2005 2:31 am
Location: Rockville, MD, USA

Post by Game_Ender »

Why don't you put this stuff on the Wiki?
User avatar
Virion
Halfling
Posts: 85
Joined: Mon Jul 24, 2006 11:06 am
Location: Malaysia
x 2

Post by Virion »

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
Emil_halim
Gnome
Posts: 337
Joined: Fri Oct 27, 2006 8:56 am
Location: Alex, Egypt
x 1
Contact:

Post by Emil_halim »

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.
Vectrex
Ogre Magi
Posts: 1266
Joined: Tue Aug 12, 2003 1:53 am
Location: Melbourne, Australia
x 1
Contact:

Post by Vectrex »

you could update your first post with the latest code/headers and add a 'edit' + date type thing
User avatar
elesgal
Kobold
Posts: 25
Joined: Thu Sep 29, 2005 4:23 pm
Location: Slovak Republic
x 1
Contact:

Post by elesgal »

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
Emil_halim
Gnome
Posts: 337
Joined: Fri Oct 27, 2006 8:56 am
Location: Alex, Egypt
x 1
Contact:

Post by Emil_halim »

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 .
Post Reply