Page 2 of 2

Posted: Fri Aug 24, 2007 2:54 pm
by alexionne
BlindSide wrote:And we can have CSkinnedAnimatedMeshIrrLogoSceneNode and have lots of fun :D
Right :-)

We can even write optimized version of CSkinnedAnimatedMeshIrrLogoSceneNodeTriangleSelector!

My original idea was that animation of Irrlich logo should be programmed, not pre-animated using some modeler/animation tool.

As of camera, it is definitely not that good idea :)

Posted: Mon Aug 27, 2007 7:50 pm
by L1zb3th
so, the idea is render into a splash screen ...
umhhhh...
so, the render, could be loaded frommm ...
an animated mesh or from a irr scene?
Au Revoir !

Posted: Tue Aug 28, 2007 5:07 pm
by bitplane
yes that's a better idea, a whole scene that is rendered to a texture. Much more flexible than forcing people to make a scene node.

Posted: Tue Aug 28, 2007 8:56 pm
by L1zb3th
umhhh, well, the idea is this, i've got a code, but i cant find the problem ..

Splash.h

Code: Select all

LRESULT CALLBACK DefaultWindowProcedure(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam){
    switch (msg)                  /* manipulador del mensaje */
    {
        case WM_DESTROY:
           PostQuitMessage(0);    /* envía un mensaje WM_QUIT a la cola de mensajes */
           break;
        default:                  /* para los mensajes de los que no nos ocupamos */
           return DefWindowProc(hwnd, msg, wParam, lParam);
    }
    return 0;
}


typedef struct IrrEnviroment{
    	irr::scene::ISceneManager* SceneManager;
    	irr::video::IVideoDriver* Driver;
    	irr::IrrlichtDevice* Device;
    	irr::gui::IGUIEnvironment* Gui;
    }IrrEnviroment;
    // this thing of namespaces it's driving me crazy ..


class SplashScreen{

    public:

        SplashScreen();
        ~SplashScreen();
        int Create(int X,int Y,int W,int H);
        bool Show();
        bool RenderLoop(bool* Render);

        LRESULT CALLBACK (*WinProcedure)(HWND, UINT, WPARAM, LPARAM);
        IrrEnviroment irrEnv;

        private:

               HWND hwnd,hRenderhWind;
               MSG msg;
               WNDCLASSEX wincl;
               bool Error;
               int W,H,X,Y;
               irr::SIrrlichtCreationParameters IrrCreationParams;


            };

               /* usually, i'm not so smartypants with names, but this
                isn't only irrlicht related, so, it could be a windows device
                so, i make the names more "descriptive"
                */

SplashScreen::SplashScreen(){
  Error^=Error;W^=W;H^=H;X^=X;Y^=Y; // Cleaning Up Or, setting to 0
  WinProcedure = DefaultWindowProcedure;
    }


int SplashScreen::Create(int X,int Y,int W,int H){
   wincl.hInstance = NULL;
   this->X = X;this->Y=Y;this->W=W;this->H=H;
   wincl.lpszClassName = "SplashScreenClass";
   wincl.lpfnWndProc = WinProcedure;
   wincl.style = CS_HREDRAW | CS_VREDRAW;
   wincl.cbSize = sizeof(WNDCLASSEX);

   wincl.hIcon = LoadIcon(NULL, IDI_APPLICATION);
   wincl.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
   wincl.hCursor = LoadCursor(NULL, IDC_ARROW);
   wincl.lpszMenuName = NULL;
   wincl.cbClsExtra = 0;
   wincl.cbWndExtra = DLGWINDOWEXTRA;
   wincl.hbrBackground = (HBRUSH)COLOR_WINDOWTEXT; /* as always is black ...
                                                     yeah, a nasty fashioned
                                                     way of saying black*/
   if(!RegisterClassEx(&wincl)) Error = true;
   if (!Error){
 hwnd = CreateWindow(wincl.lpszClassName,"",WS_POPUP|SW_HIDE,X,Y,W,H,NULL, NULL,NULL, NULL);
 if (hwnd==NULL) Error = true;
}

// empotremos el puto irrlich :@

hRenderhWind = CreateWindow("RenderWin", "", WS_CHILD | BS_OWNERDRAW | WS_VISIBLE  ,X,Y,W,H, hwnd, NULL, NULL, NULL);

IrrCreationParams.WindowId = reinterpret_cast<irr::s32> (hRenderhWind );
IrrCreationParams.DriverType = irr::video::EDT_OPENGL;
irrEnv.Device = irr::createDeviceEx(IrrCreationParams);
irrEnv.SceneManager = irrEnv.Device->getSceneManager();
irrEnv.Driver = irrEnv.Device->getVideoDriver();
irrEnv.Gui = irrEnv.Device->getGUIEnvironment();


    return !Error;
}

bool SplashScreen::Show(){
    if (Error) return false;
    ShowWindow(hwnd, SW_SHOWDEFAULT);
    }


bool SplashScreen::RenderLoop(bool* Render){
 	while (irrEnv.Device->run()&& *Render==true ){
		irrEnv.Driver->beginScene(true, true, 0);
		irrEnv.SceneManager->drawAll();
		irrEnv.Gui->drawAll();
	    irrEnv.Driver ->endScene();
	}
}

    // here we could use a Get() function to return the struct, umhh, but, its public xD

SplashScreen::~SplashScreen(){

    }




Main.cpp

Code: Select all


#include <Windows.h>
#include <Irrlicht/Irrlicht.h>
#include "Splash.h"
#define ret return // dont gently caress with this xD



SplashScreen* Splash; // the splash itself

int DisplayH,DisplayW; // the Widht and height of screen

bool Render = true; // this is used for the rendering, the only way of broke RenderLoop is changing this value :roll: 

void GetRes(); // using WinGDI for obtaining it ...

int WINAPI WinMain(
    HINSTANCE hInstance,
    HINSTANCE hPrevInstance,
    LPSTR lpCmdLine,
    int nCmdShow){

         FreeConsole(); // funking console xD
          GetRes(); // we fill the info ...

        Splash  = new SplashScreen(); // we create the splash screen
        Splash->Create((DisplayW-400)/2,(DisplayH-200)/2,400,200); // here we create it with 400x200 size, centered on screen (W,H,X,Y)
        Splash->Show(); // we show it ..
        irr::gui::IGUIImage* Image =  Splash->irrEnv.Gui->addImage(Splash->irrEnv.Driver->getTexture("Test.jpg"),irr::core::position2d<int>(1,1)); // just a nasty fashioned way of testing xD
        Splash->RenderLoop(&Render); // the renderloop

    ret 1;
}


void GetRes(){
// ignore this xD
     HDC DisplayDC = GetDC(GetDesktopWindow());
     DisplayW = GetDeviceCaps(DisplayDC,HORZRES);
     DisplayH = GetDeviceCaps(DisplayDC,VERTRES);
     DeleteDC(DisplayDC);
     }
what part of CreateWindow() or CreateDeviceEx() doesn't understan that the second window is a child ? :evil: damned xD
wel, i will se the problem ...

i forgot, once created the splash and with the struct, the user can do all the render work that he want ..

Au Revoir !

Posted: Sun Sep 16, 2007 12:57 am
by L1zb3th
umhhh, is somebody there ? xD
Au Revoir xP

Posted: Thu Mar 12, 2009 4:47 pm
by LunarEffect
Good idea, I like it =D

Posted: Thu Mar 12, 2009 7:57 pm
by wITTus
Desecration of dead threads! :lol:

Posted: Wed Aug 12, 2009 8:26 pm
by grumpymonkey
irrlicht is free and opensource and you dont have to put the irrlicht logo on your projects, and usually people dont want to do it either. a competition like this will make it look like we have to do it or something.