Real time splash window
-
- Posts: 518
- Joined: Tue Mar 29, 2005 9:02 pm
- Location: Alex,Egypt
- Contact:
Real time splash window
hi all
sometimes we need a real splash window (a window without title bar) in our game for
making our game introduction.
so i create a TSplash class, that allow you to changes your Irrlicht window to appeare as a splash window,also you could control of the time that the splash window will stay on our screen then the orignal window will appeare automatically.
you could put your splash code in a separate bool function,so that the splash window will stay untill the time is or the function return false, you could use it to skip the rest of introuduction if the user take some action like press escap or press any mouse buttom.
here is a link
http://www.irrforge.org/index.php/Real_ ... h_Irrlicht
sometimes we need a real splash window (a window without title bar) in our game for
making our game introduction.
so i create a TSplash class, that allow you to changes your Irrlicht window to appeare as a splash window,also you could control of the time that the splash window will stay on our screen then the orignal window will appeare automatically.
you could put your splash code in a separate bool function,so that the splash window will stay untill the time is or the function return false, you could use it to skip the rest of introuduction if the user take some action like press escap or press any mouse buttom.
here is a link
http://www.irrforge.org/index.php/Real_ ... h_Irrlicht
Magic 2d Library For Irrlicht : http://www.freewebs.com/bcxgl/index.htm
http://www.freewebs.com/bcxdx/index.htm
http://groups.yahoo.com/group/bcxdxc/
http://www.freewebs.com/bcxdx/index.htm
http://groups.yahoo.com/group/bcxdxc/
-
- Posts: 69
- Joined: Mon May 23, 2005 4:42 pm
I just put some code on the wiki too:
http://www.irrforge.org/index.php/Custo ... ra_control
I'd be happy if some admin or something could look it over. This is my first contact with wikis..
http://www.irrforge.org/index.php/Custo ... ra_control
I'd be happy if some admin or something could look it over. This is my first contact with wikis..
Should put something witty here I suppose.
-
- Posts: 518
- Joined: Tue Mar 29, 2005 9:02 pm
- Location: Alex,Egypt
- Contact:
thanks a lotafecelis wrote:wow! this looks tremendously helpful! thnx! your tuts at irrforge rock!
Magic 2d Library For Irrlicht : http://www.freewebs.com/bcxgl/index.htm
http://www.freewebs.com/bcxdx/index.htm
http://groups.yahoo.com/group/bcxdxc/
http://www.freewebs.com/bcxdx/index.htm
http://groups.yahoo.com/group/bcxdxc/
-
- Posts: 518
- Joined: Tue Mar 29, 2005 9:02 pm
- Location: Alex,Egypt
- Contact:
i have extend the feature of class so that you could resize the splash window as you
prefer and ofcourse it will be centered in the screen then the orignal window of irrlicht
will appeare as you dimensioned it when creating the Device.
http://www.irrforge.org/index.php/Real_ ... h_Irrlicht
prefer and ofcourse it will be centered in the screen then the orignal window of irrlicht
will appeare as you dimensioned it when creating the Device.
http://www.irrforge.org/index.php/Real_ ... h_Irrlicht
Magic 2d Library For Irrlicht : http://www.freewebs.com/bcxgl/index.htm
http://www.freewebs.com/bcxdx/index.htm
http://groups.yahoo.com/group/bcxdxc/
http://www.freewebs.com/bcxdx/index.htm
http://groups.yahoo.com/group/bcxdxc/
getting the following errors:
how do we declare your "splah" class?
and "mesh" and "node" hadn't been declared.
or am I doing something wrong?
Code: Select all
main.cpp(40) : error C2065: 'splah' : undeclared identifier
main.cpp(41) : error C2227: left of '->playSplash' must point to class/struct/union
type is ''unknown-type''
main.cpp(41) : error C3861: 'splah': identifier not found, even with argument-dependent lookup
main.cpp(52) : error C2562: 'main' : 'void' function returning a value
and "mesh" and "node" hadn't been declared.
Code: Select all
IAnimatedMesh* mesh =0; //added this line
mesh=irrSceneMgr->getMesh("media/sydney.md2");
IAnimatedMeshSceneNode* node =0; //added this line
node=irrSceneMgr->addAnimatedMeshSceneNode(mesh);
-
- Posts: 518
- Joined: Tue Mar 29, 2005 9:02 pm
- Location: Alex,Egypt
- Contact:
thanks for telling that error.
it is only error of forgot to declare the class,any way here is the correct code
i will post it to wiki.i have tested it with Dev-C++
it is only error of forgot to declare the class,any way here is the correct code
i will post it to wiki.i have tested it with Dev-C++
Code: Select all
#include <windows.h>
#include "irrlicht.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
#include "CSplash.cpp"
static IrrlichtDevice *irrDevice;
static IVideoDriver *irrVideo;
static ISceneManager *irrSceneMgr;
static ITexture *images;
BOOL RenderSplash (void);
int main(int argc, char *argv[])
{
irrDevice=createDevice(EDT_DIRECTX9,dimension2d<s32>(640,480),32,FALSE,FALSE,FALSE,0);
irrDevice->setWindowCaption(L"Splash class demo by Emil Halim");
irrVideo=irrDevice->getVideoDriver();
irrSceneMgr=irrDevice->getSceneManager();
images=irrVideo->getTexture("media/2ddemo.bmp");
irrVideo->makeColorKeyTexture(images,position2d<s32>(0,0));
IAnimatedMesh* mesh=irrSceneMgr->getMesh("media/sydney.md2");
IAnimatedMeshSceneNode* node=irrSceneMgr->addAnimatedMeshSceneNode(mesh);
node->setMaterialFlag(EMF_LIGHTING,FALSE);
node->setFrameLoop(0,310);
node->setMaterialTexture(0,irrVideo->getTexture("media/sydney.bmp"));
irrSceneMgr->addCameraSceneNode(0,vector3df(0,30,-40),vector3df(0,5,0));
TSplash* splah= new TSplash(irrVideo);
splah->playSplash(RenderSplash,5000,342,224);
while(irrDevice->run())
{
irrVideo->beginScene(TRUE,TRUE,SColor(0,200,200,200));
irrSceneMgr->drawAll();
irrVideo->endScene();
}
irrDevice->drop();
return 0;
}
BOOL RenderSplash (void)
{
irrDevice->run();
irrVideo->beginScene(TRUE,TRUE,SColor(0,0,0,0));
irrVideo->draw2DImage(images,position2d<s32>(0,0),rect<s32>(0,0,342,224),0,SColor(255,255,255,255),TRUE);
// irrSceneMgr->drawAll();
irrVideo->endScene();
return TRUE;
}
Magic 2d Library For Irrlicht : http://www.freewebs.com/bcxgl/index.htm
http://www.freewebs.com/bcxdx/index.htm
http://groups.yahoo.com/group/bcxdxc/
http://www.freewebs.com/bcxdx/index.htm
http://groups.yahoo.com/group/bcxdxc/
things got worse!
Code: Select all
CSplash.cpp(3) : error C2065: 'MY_BOOLFUNC_TYPE' : undeclared identifier
CSplash.cpp(3) : error C2501: 'BOOL' : missing storage-class or type specifiers
CSplash.cpp(3) : error C2143: syntax error : missing ';' before '('
CSplash.cpp(3) : error C2062: type 'void' unexpected
CSplash.cpp(3) : error C2059: syntax error : ')'
CSplash.cpp(6) : error C2146: syntax error : missing ';' before identifier 'mywind'
CSplash.cpp(6) : error C2501: 'TSplash::HWND' : missing storage-class or type specifiers
CSplash.cpp(6) : error C2501: 'TSplash::mywind' : missing storage-class or type specifiers
CSplash.cpp(7) : error C2146: syntax error : missing ';' before identifier 'oldStyle'
CSplash.cpp(7) : error C2501: 'TSplash::DWORD' : missing storage-class or type specifiers
CSplash.cpp(7) : error C2501: 'TSplash::oldStyle' : missing storage-class or type specifiers
CSplash.cpp(8) : error C2143: syntax error : missing ';' before '<'
CSplash.cpp(8) : error C2501: 'TSplash::dimension2d' : missing storage-class or type specifiers
CSplash.cpp(8) : error C2238: unexpected token(s) preceding ';'
CSplash.cpp(11) : error C2143: syntax error : missing ')' before '*'
CSplash.cpp(11) : error C2143: syntax error : missing ';' before '*'
CSplash.cpp(11) : error C2460: 'TSplash::IVideoDriver' : uses 'TSplash', which is being defined
CSplash.cpp(5) : see declaration of 'TSplash'
CSplash.cpp(11) : error C2059: syntax error : ')'
CSplash.cpp(11) : error C2501: 'TSplash::ivd' : missing storage-class or type specifiers
CSplash.cpp(13) : error C2146: syntax error : missing ';' before identifier 'Dat'
CSplash.cpp(13) : error C2501: 'TSplash::SExposedVideoData' : missing storage-class or type specifiers
CSplash.cpp(13) : error C2065: 'ivd' : undeclared identifier
CSplash.cpp(13) : error C2227: left of '->getExposedVideoData' must point to class/struct/union
type is ''unknown-type''
CSplash.cpp(13) : error C2864: 'Dat' : only const static integral data members can be initialized inside a class or struct
CSplash.cpp(13) : error C2501: 'TSplash::Dat' : missing storage-class or type specifiers
CSplash.cpp(14) : error C2065: 'HWND' : undeclared identifier
CSplash.cpp(14) : error C2864: 'mywind' : only const static integral data members can be initialized inside a class or struct
CSplash.cpp(14) : error C2501: 'TSplash::mywind' : missing storage-class or type specifiers
CSplash.cpp(14) : error C2146: syntax error : missing ';' before identifier 'Dat'
CSplash.cpp(14) : error C2143: syntax error : missing ';' before '.'
CSplash.cpp(14) : error C2501: 'TSplash::Dat' : missing storage-class or type specifiers
CSplash.cpp(14) : error C2238: unexpected token(s) preceding ';'
CSplash.cpp(15) : error C2065: 'mywind' : undeclared identifier
CSplash.cpp(15) : error C2065: 'GWL_STYLE' : undeclared identifier
CSplash.cpp(15) : error C3861: 'GetWindowLong': identifier not found, even with argument-dependent lookup
CSplash.cpp(15) : error C2864: 'oldStyle' : only const static integral data members can be initialized inside a class or struct
CSplash.cpp(15) : error C2501: 'TSplash::oldStyle' : missing storage-class or type specifiers
CSplash.cpp(16) : error C2061: syntax error : identifier 'mywind'
CSplash.cpp(16) : error C2059: syntax error : ')'
CSplash.cpp(16) : error C2143: syntax error : missing ')' before ';'
CSplash.cpp(16) : warning C4183: 'SetWindowLong': missing return type; assumed to be a member function returning 'int'
CSplash.cpp(17) : error C2227: left of '->getScreenSize' must point to class/struct/union
type is ''unknown-type''
CSplash.cpp(17) : error C3861: 'ivd': identifier not found, even with argument-dependent lookup
CSplash.cpp(17) : error C2864: 'size' : only const static integral data members can be initialized inside a class or struct
CSplash.cpp(17) : error C2501: 'TSplash::size' : missing storage-class or type specifiers
CSplash.cpp(20) : error C2588: '::~TSplash' : illegal global destructor
CSplash.cpp(22) : error C3861: 'MY_BOOLFUNC_TYPE': identifier not found, even with argument-dependent lookup
CSplash.cpp(22) : error C2146: syntax error : missing ')' before identifier 'func'
CSplash.cpp(22) : error C2182: 'playSplash' : illegal use of type 'void'
CSplash.cpp(22) : error C2059: syntax error : ')'
CSplash.cpp(23) : error C2143: syntax error : missing ';' before '{'
CSplash.cpp(23) : error C2447: '{' : missing function header (old-style formal list?)
CSplash.cpp(43) : error C2059: syntax error : '}'
CSplash.cpp(43) : error C2143: syntax error : missing ';' before '}'
CSplash.cpp(43) : error C2059: syntax error : '}'
Process terminated with status 1 (0 minutes, 1 seconds)
54 errors, 1 warnings
-
- Posts: 518
- Joined: Tue Mar 29, 2005 9:02 pm
- Location: Alex,Egypt
- Contact:
i think that all those errors becouse of BOOL type.
any way did you include the windows header in the fornt of code as
shown in demo, if so it must have define the BOOL type in it's header
the same thing for HWND type and DWORD type
please if it still does not work,let me know.
it works very will with me.
any way did you include the windows header in the fornt of code as
shown in demo, if so it must have define the BOOL type in it's header
the same thing for HWND type and DWORD type
please if it still does not work,let me know.
it works very will with me.
Magic 2d Library For Irrlicht : http://www.freewebs.com/bcxgl/index.htm
http://www.freewebs.com/bcxdx/index.htm
http://groups.yahoo.com/group/bcxdxc/
http://www.freewebs.com/bcxdx/index.htm
http://groups.yahoo.com/group/bcxdxc/
you mean this?
sure I got it; I completely copy-pasted your code
Code: Select all
#include <windows.h>
-
- Posts: 518
- Joined: Tue Mar 29, 2005 9:02 pm
- Location: Alex,Egypt
- Contact:
yes i ment that.
but it is very strang, this code compile and run without any error with
Dev-C++.
but it is very strang, this code compile and run without any error with
Dev-C++.
Magic 2d Library For Irrlicht : http://www.freewebs.com/bcxgl/index.htm
http://www.freewebs.com/bcxdx/index.htm
http://groups.yahoo.com/group/bcxdxc/
http://www.freewebs.com/bcxdx/index.htm
http://groups.yahoo.com/group/bcxdxc/
-
- Posts: 518
- Joined: Tue Mar 29, 2005 9:02 pm
- Location: Alex,Egypt
- Contact:
i have posted a zip file that contain source code ,so could you download it
from
http://www.irrforge.org/index.php/Real_ ... h_Irrlicht
from
http://www.irrforge.org/index.php/Real_ ... h_Irrlicht
Magic 2d Library For Irrlicht : http://www.freewebs.com/bcxgl/index.htm
http://www.freewebs.com/bcxdx/index.htm
http://groups.yahoo.com/group/bcxdxc/
http://www.freewebs.com/bcxdx/index.htm
http://groups.yahoo.com/group/bcxdxc/
-
- Posts: 518
- Joined: Tue Mar 29, 2005 9:02 pm
- Location: Alex,Egypt
- Contact:
still waiting for the results of yuor test!!!
and if it works ,what was the reasone?
and if it works ,what was the reasone?
Magic 2d Library For Irrlicht : http://www.freewebs.com/bcxgl/index.htm
http://www.freewebs.com/bcxdx/index.htm
http://groups.yahoo.com/group/bcxdxc/
http://www.freewebs.com/bcxdx/index.htm
http://groups.yahoo.com/group/bcxdxc/