* added basic GUI functionality; using the Irrlicht-Engine (http://irrlicht.sourceforge.net)

* dropped now redundant and bloated SDL
* added the irrlicht files to the repository.
* NOTE: to compile PseuWoW now, you need to have the DirectX SDK installed, unless you disable build of DirectX 9 !!!
This commit is contained in:
False.Genesis 2007-04-04 01:19:06 +00:00
parent 5c267fe5aa
commit 71e2f7f224
1476 changed files with 294724 additions and 177962 deletions

View File

@ -1,6 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 8.00
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PseuWoW", "src\PseuWoW.vcproj", "{EFFE60F4-DA39-41E8-9E53-E462000A2D91}"
ProjectSection(ProjectDependencies) = postProject
{E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F}
{8F1DEA42-6A5B-4B62-839D-C141A7BFACF2} = {8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}
{F548FC51-24A4-45FF-A381-BEBC39F18270} = {F548FC51-24A4-45FF-A381-BEBC39F18270}
{262199E8-EEDF-4700-A1D1-E9CC901CF480} = {262199E8-EEDF-4700-A1D1-E9CC901CF480}
@ -20,34 +21,59 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shared", "src\shared.vcproj
{262199E8-EEDF-4700-A1D1-E9CC901CF480} = {262199E8-EEDF-4700-A1D1-E9CC901CF480}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL", "src\SDL.vcproj", "{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Irrlicht", "src\dep\src\irrlicht\Irrlicht7.1.vcproj", "{E08E042A-6C45-411B-92BE-3CC31331019F}"
ProjectSection(ProjectDependencies) = postProject
{8F1DEA42-6A5B-4B62-839D-C141A7BFACF2} = {8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
Debug = Debug
Relase - Fast FPU = Relase - Fast FPU
Release = Release
Release - Fast FPU DebugInfo = Release - Fast FPU DebugInfo
EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution
{EFFE60F4-DA39-41E8-9E53-E462000A2D91}.Debug.ActiveCfg = Debug|Win32
{EFFE60F4-DA39-41E8-9E53-E462000A2D91}.Debug.Build.0 = Debug|Win32
{EFFE60F4-DA39-41E8-9E53-E462000A2D91}.Relase - Fast FPU.ActiveCfg = Release|Win32
{EFFE60F4-DA39-41E8-9E53-E462000A2D91}.Relase - Fast FPU.Build.0 = Release|Win32
{EFFE60F4-DA39-41E8-9E53-E462000A2D91}.Release.ActiveCfg = Release|Win32
{EFFE60F4-DA39-41E8-9E53-E462000A2D91}.Release.Build.0 = Release|Win32
{EFFE60F4-DA39-41E8-9E53-E462000A2D91}.Release - Fast FPU DebugInfo.ActiveCfg = Release|Win32
{EFFE60F4-DA39-41E8-9E53-E462000A2D91}.Release - Fast FPU DebugInfo.Build.0 = Release|Win32
{8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Debug.ActiveCfg = Debug|Win32
{8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Debug.Build.0 = Debug|Win32
{8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Relase - Fast FPU.ActiveCfg = Release|Win32
{8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Relase - Fast FPU.Build.0 = Release|Win32
{8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Release.ActiveCfg = Release|Win32
{8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Release.Build.0 = Release|Win32
{8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Release - Fast FPU DebugInfo.ActiveCfg = Release|Win32
{8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Release - Fast FPU DebugInfo.Build.0 = Release|Win32
{262199E8-EEDF-4700-A1D1-E9CC901CF480}.Debug.ActiveCfg = Debug|Win32
{262199E8-EEDF-4700-A1D1-E9CC901CF480}.Debug.Build.0 = Debug|Win32
{262199E8-EEDF-4700-A1D1-E9CC901CF480}.Relase - Fast FPU.ActiveCfg = Release|Win32
{262199E8-EEDF-4700-A1D1-E9CC901CF480}.Relase - Fast FPU.Build.0 = Release|Win32
{262199E8-EEDF-4700-A1D1-E9CC901CF480}.Release.ActiveCfg = Release|Win32
{262199E8-EEDF-4700-A1D1-E9CC901CF480}.Release.Build.0 = Release|Win32
{262199E8-EEDF-4700-A1D1-E9CC901CF480}.Release - Fast FPU DebugInfo.ActiveCfg = Release|Win32
{262199E8-EEDF-4700-A1D1-E9CC901CF480}.Release - Fast FPU DebugInfo.Build.0 = Release|Win32
{F548FC51-24A4-45FF-A381-BEBC39F18270}.Debug.ActiveCfg = Debug|Win32
{F548FC51-24A4-45FF-A381-BEBC39F18270}.Debug.Build.0 = Debug|Win32
{F548FC51-24A4-45FF-A381-BEBC39F18270}.Relase - Fast FPU.ActiveCfg = Release|Win32
{F548FC51-24A4-45FF-A381-BEBC39F18270}.Relase - Fast FPU.Build.0 = Release|Win32
{F548FC51-24A4-45FF-A381-BEBC39F18270}.Release.ActiveCfg = Release|Win32
{F548FC51-24A4-45FF-A381-BEBC39F18270}.Release.Build.0 = Release|Win32
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug.ActiveCfg = Debug|Win32
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release.ActiveCfg = Release|Win32
{F548FC51-24A4-45FF-A381-BEBC39F18270}.Release - Fast FPU DebugInfo.ActiveCfg = Release|Win32
{F548FC51-24A4-45FF-A381-BEBC39F18270}.Release - Fast FPU DebugInfo.Build.0 = Release|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Debug.ActiveCfg = Debug|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Debug.Build.0 = Debug|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Relase - Fast FPU.ActiveCfg = Relase - Fast FPU|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Relase - Fast FPU.Build.0 = Relase - Fast FPU|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Release.ActiveCfg = Release|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Release.Build.0 = Release|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU DebugInfo.ActiveCfg = Release - Fast FPU DebugInfo|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU DebugInfo.Build.0 = Release - Fast FPU DebugInfo|Win32
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection

View File

@ -96,4 +96,11 @@ defaultlang=0
// other servers might be different
cmdchar=.
// set this to 1 if you want to have a 3D-window showing stuff
// NOTE: this is only to activate the window for now, 3D-stuff will come later!!
// until some frame-limiter is implemented, it will always use 100% CPU usage when
// the GUI is enabled and activated. (if its in background - 0% CPU load.)
enablegui=0

173
src/Client/GUI/PseuGUI.cpp Normal file
View File

@ -0,0 +1,173 @@
#include "common.h"
#include "irrlicht/irrlicht.h"
#include "PseuWoW.h"
#include "PseuGUI.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
enum DriverIDs
{
NULLDEVICE = 0,
SOFTWARE = 1,
BURNINGSVIDEO = 2,
OPENGL = 3,
DIRECTX8 = 4,
DIRECTX9 = 5,
};
PseuGUIRunnable::PseuGUIRunnable()
{
_gui = new PseuGUI();
}
void PseuGUIRunnable::run(void)
{
_gui->Run();
}
PseuGUI *PseuGUIRunnable::GetGUI(void)
{
return _gui;
}
PseuGUIRunnable::~PseuGUIRunnable()
{
delete _gui;
}
PseuGUI::PseuGUI()
{
_xres = 640;
_yres = 480;
_colordepth = 32;
_shadows = false;
_windowed = true;
_vsync = false;
_initialized = false;
_mustdie = false;
_driverType = video::EDT_BURNINGSVIDEO; // nulldevice makes not really a sense to display stuff
}
PseuGUI::~PseuGUI()
{
this->Shutdown();
}
void PseuGUI::SetInstance(PseuInstance *i)
{
_instance = i;
}
void PseuGUI::SetDriver(uint8 driverId)
{
switch(driverId)
{
case DIRECTX9: _driverType = video::EDT_DIRECT3D9;break;
case DIRECTX8: _driverType = video::EDT_DIRECT3D8;break;
case OPENGL: _driverType = video::EDT_OPENGL; break;
case SOFTWARE: _driverType = video::EDT_SOFTWARE; break;
case BURNINGSVIDEO: _driverType = video::EDT_BURNINGSVIDEO;break;
case NULLDEVICE: _driverType = video::EDT_NULL; break;
default: _driverType = video::EDT_BURNINGSVIDEO; // if no valid driver detected, use software
}
// TODO: add support for changing driver during runtime?
}
void PseuGUI::SetResolution(uint16 x, uint16 y, uint16 depth)
{
_xres = x;
_yres = y;
_colordepth = depth;
}
void PseuGUI::SetWindowed(bool b)
{
_windowed = b;
// see PseuGUI::Init(): !_windowed == fullscreen
}
void PseuGUI::SetVSync(bool b)
{
_vsync = b;
}
void PseuGUI::UseShadows(bool b)
{
_shadows = b;
}
// if this fuction is called fom another thread the device will not work correctly. o_O
void PseuGUI::_Init(void)
{
_device = createDevice(_driverType,dimension2d<s32>(_xres,_yres),_colordepth,!_windowed,_shadows,_vsync);
DEBUG(logdebug("PseuGUI::Init() _device=%X",_device));
_device->setWindowCaption(L"PseuWoW - Initializing");
_driver = _device->getVideoDriver();
_smgr = _device->getSceneManager();
//...
_initialized = true;
}
void PseuGUI::Shutdown(void)
{
_mustdie = true;
if(_device)
{
_device->drop();
_device = NULL;
}
}
void PseuGUI::Run(void)
{
if(!_initialized)
this->_Init();
DEBUG(logdebug("PseuGUI::Run() _device=%X",_device));
int lastFPS = -1, fps = -1;
while(_device && _device->run() && !_mustdie)
{
if (_device->isWindowActive())
{
_driver->beginScene(true, true, 0);
_smgr->drawAll();
_driver->endScene();
fps = _driver->getFPS();
if (lastFPS != fps)
{
core::stringw str = L"PseuWoW [";
str += _driver->getName();
str += "] FPS:";
str += fps;
// this call does actually lock up the whole window, and i just dont know why; but definitely a threading issue.
_device->setWindowCaption(str.c_str());
lastFPS = fps;
DEBUG(logdebug("PseuGUI: Current FPS: %u",fps));
}
}
else
{
_device->setWindowCaption(L"PseuWoW - Halted");
_device->yield();
}
}
DEBUG(logdebug("PseuGUI::Run() finished"));
Shutdown();
}

54
src/Client/GUI/PseuGUI.h Normal file
View File

@ -0,0 +1,54 @@
#ifndef PSEUGUI_H
#define PSEUGUI_H
#include "irrlicht/irrlicht.h"
class PseuGUI;
class PseuInstance;
class PseuGUIRunnable : public ZThread::Runnable
{
public:
PseuGUIRunnable();
~PseuGUIRunnable();
void run(void);
PseuGUI *GetGUI(void);
private:
PseuGUI* _gui;
};
class PseuGUI
{
public:
PseuGUI();
~PseuGUI();
void Run(void);
void SetInstance(PseuInstance*);
void SetDriver(uint8);
void SetResolution(uint16 x, uint16 y, uint16 depth=32);
void SetWindowed(bool);
void SetVSync(bool);
void UseShadows(bool);
void Shutdown(void);
private:
void _Init(void);
uint16 _xres,_yres,_colordepth;
bool _windowed,_vsync,_shadows;
bool _initialized,_mustdie;
PseuInstance *_instance;
irr::IrrlichtDevice *_device;
irr::video::IVideoDriver* _driver;
irr::scene::ISceneManager* _smgr;
irr::gui::IGUIEnvironment* _guienv;
irr::video::E_DRIVER_TYPE _driverType;
};
#endif

View File

@ -12,6 +12,7 @@
#include "Realm/RealmSocket.h"
#include "World/WorldSession.h"
#include "CacheHandler.h"
#include "GUI/PseuGUI.h"
#include "Cli.h"
@ -138,6 +139,16 @@ bool PseuInstance::Init(void) {
ZThread::Thread t(_cli);
}
// TODO: find a better loaction where to place this block!
if(GetConf()->enablegui)
{
PseuGUIRunnable *rgui = new PseuGUIRunnable();
PseuGUI *gui = rgui->GetGUI();
gui->SetInstance(this);
// TODO: set resolution, shadows(on/off) and more here...
ZThread::Thread *t = new ZThread::Thread(rgui);
}
if(_error)
{
logcritical("Errors while initializing!");
@ -291,6 +302,10 @@ void PseuInstanceConf::ApplyFromVarSet(VarSet &v)
showmyopcodes=(bool)atoi(v.Get("SHOWMYOPCODES").c_str());
disablespellcheck=(bool)atoi(v.Get("DISABLESPELLCHECK").c_str());
// gui related
enablegui=(bool)atoi(v.Get("ENABLEGUI").c_str());
// TODO: add configs for resolution, fullscreen, etc. see PseuGUI::... for a list of functions.
// clientversion is a bit more complicated to add
{
std::string opt=clientversion_string + ".";

View File

@ -49,6 +49,10 @@ class PseuInstanceConf
bool showmyopcodes;
bool disablespellcheck;
// gui related
bool enablegui;
// need more here
};
@ -108,7 +112,7 @@ class PseuInstance
class PseuInstanceRunnable : public ZThread::Runnable
{
public:
PseuInstanceRunnable::PseuInstanceRunnable();
PseuInstanceRunnable();
void run(void);
void sleep(uint32);
PseuInstance *GetInstance(void) { return _i; }

View File

@ -52,6 +52,7 @@
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories=""
IgnoreAllDefaultLibraries="FALSE"
IgnoreDefaultLibraryNames="libci.lib"
AssemblyDebug="0"
ProgramDatabaseFile="$(SolutionDir)/temp/$(ProjectName)/Release/PseuWoW.pdb"
SubSystem="1"
@ -117,6 +118,7 @@
LinkIncremental="2"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories=""
IgnoreDefaultLibraryNames="libci.lib"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="$(SolutionDir)/temp/$(ProjectName)/PseuWoW.pdb"
SubSystem="1"
@ -394,6 +396,16 @@
RelativePath=".\Client\Realm\RealmSocket.h">
</File>
</Filter>
<Filter
Name="GUI"
Filter="">
<File
RelativePath=".\Client\Gui\PseuGUI.cpp">
</File>
<File
RelativePath=".\Client\Gui\PseuGUI.h">
</File>
</Filter>
</Filter>
<Filter
Name="Resource Files"
@ -408,6 +420,397 @@
RelativePath=".\Client\resource.h">
</File>
</Filter>
<Filter
Name="Irrlicht Include"
Filter="">
<File
RelativePath=".\dep\include\irrlicht\aabbox3d.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\coreutil.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\dimension2d.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\EDriverTypes.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\EGUIElementTypes.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\ESceneNodeAnimatorTypes.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\ESceneNodeTypes.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\ETerrainElements.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\fast_atof.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\heapsort.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IAnimatedMesh.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IAnimatedMeshB3d.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IAnimatedMeshMD2.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IAnimatedMeshMD3.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IAnimatedMeshMS3D.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IAnimatedMeshSceneNode.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IAnimatedMeshX.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IAttributeExchangingObject.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IAttributes.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IBillboardSceneNode.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\ICameraSceneNode.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\ICursorControl.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IDummyTransformationSceneNode.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IEventReceiver.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IFileList.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IFileSystem.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IGPUProgrammingServices.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IGUIButton.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IGUICheckBox.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IGUIColorSelectDialog.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IGUIComboBox.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IGUIContextMenu.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IGUIEditBox.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IGUIElement.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IGUIElementFactory.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IGUIEnvironment.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IGUIFileOpenDialog.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IGUIFont.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IGUIFontBitmap.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IGUIImage.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IGUIInOutFader.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IGUIListBox.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IGUIMeshViewer.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IGUIScrollBar.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IGUISkin.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IGUISpriteBank.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IGUIStaticText.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IGUITabControl.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IGUIToolbar.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IGUIWindow.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IImage.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IImageLoader.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IImageWriter.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\ILightSceneNode.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\ILogger.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IMaterialRenderer.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IMaterialRendererServices.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IMesh.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IMeshBuffer.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IMeshCache.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IMeshLoader.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IMeshManipulator.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IMeshSceneNode.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IMetaTriangleSelector.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IOSOperator.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IParticleAffector.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IParticleEmitter.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IParticleSystemSceneNode.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IQ3LevelMesh.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IQ3Shader.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IReadFile.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\irrAllocator.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\irrArray.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IrrCompileConfig.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\irrlicht.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IrrlichtDevice.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\irrList.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\irrMap.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\irrMath.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\irrString.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\irrTypes.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\irrXML.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\ISceneCollisionManager.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\ISceneManager.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\ISceneNode.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\ISceneNodeAnimator.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\ISceneNodeAnimatorCollisionResponse.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\ISceneNodeAnimatorFactory.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\ISceneNodeFactory.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\ISceneUserDataSerializer.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IShaderConstantSetCallBack.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IShadowVolumeSceneNode.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\ITerrainSceneNode.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\ITextSceneNode.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\ITexture.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\ITimer.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\ITriangleSelector.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IUnknown.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IVideoDriver.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IVideoModeList.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IWriteFile.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IXMLReader.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\IXMLWriter.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\Keycodes.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\line2d.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\line3d.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\matrix4.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\plane3d.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\position2d.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\quaternion.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\rect.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\S3DVertex.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\SAnimatedMesh.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\SceneParameters.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\SColor.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\SExposedVideoData.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\SIrrCreationParameters.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\SKeyMap.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\SLight.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\SMaterial.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\SMesh.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\SMeshBuffer.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\SMeshBufferLightMap.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\SMeshBufferTangents.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\SParticle.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\SViewFrustum.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\triangle3d.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\vector2d.h">
</File>
<File
RelativePath=".\dep\include\irrlicht\vector3d.h">
</File>
</Filter>
</Files>
<Globals>
</Globals>

View File

@ -1,462 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="SDL"
ProjectGUID="{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}"
RootNamespace="SDL">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)/temp/$(ProjectName)/$(ConfigurationName)"
IntermediateDirectory="$(SolutionDir)/temp/$(ProjectName)/$(ConfigurationName)"
ConfigurationType="4"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="dep/include/SDL;dep/src/SDL;dep/include"
PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_DEBUG;_WINDOWS;_WIN32_WINNT=0x0400"
RuntimeLibrary="1"
BufferSecurityCheck="FALSE"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\Debug/SDL.pch"
AssemblerListingLocation="$(SolutionDir)/temp/$(ProjectName)/$(ConfigurationName)/"
ObjectFile="$(SolutionDir)/temp/$(ProjectName)/$(ConfigurationName)/"
ProgramDataBaseFileName="$(SolutionDir)/temp/$(ProjectName)/$(ConfigurationName)/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
Detect64BitPortabilityProblems="FALSE"
DebugInformationFormat="4"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"
OutputFile="dep/lib/debug/SDL.lib"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\Debug/SDL.tlb"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)/temp/$(ProjectName)/$(ConfigurationName)"
IntermediateDirectory="$(SolutionDir)/temp/$(ProjectName)/$(ConfigurationName)"
ConfigurationType="4"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE">
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
EnableIntrinsicFunctions="FALSE"
AdditionalIncludeDirectories="dep/include/SDL;dep/src/SDL;dep/include"
PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0400"
StringPooling="TRUE"
RuntimeLibrary="0"
BufferSecurityCheck="FALSE"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\Release/SDL.pch"
AssemblerListingLocation="$(SolutionDir)/temp/$(ProjectName)/$(ConfigurationName)/"
ObjectFile="$(SolutionDir)/temp/$(ProjectName)/$(ConfigurationName)/"
ProgramDataBaseFileName="$(SolutionDir)/temp/$(ProjectName)/$(ConfigurationName)/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
Detect64BitPortabilityProblems="FALSE"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"
OutputFile="dep/lib/release/SDL.lib"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\Release/SDL.tlb"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<File
RelativePath="dep\src\SDL\SDL.c">
</File>
<File
RelativePath="dep\src\SDL\events\SDL_active.c">
</File>
<File
RelativePath="dep\src\SDL\audio\SDL_audio.c">
</File>
<File
RelativePath="dep\src\SDL\audio\SDL_audio_c.h">
</File>
<File
RelativePath="dep\src\SDL\audio\SDL_audiocvt.c">
</File>
<File
RelativePath="dep\src\SDL\audio\SDL_audiomem.h">
</File>
<File
RelativePath="dep\src\SDL\video\SDL_blit.c">
</File>
<File
RelativePath="dep\src\SDL\video\SDL_blit.h">
</File>
<File
RelativePath="dep\src\SDL\video\SDL_blit_0.c">
</File>
<File
RelativePath="dep\src\SDL\video\SDL_blit_1.c">
</File>
<File
RelativePath="dep\src\SDL\video\SDL_blit_A.c">
</File>
<File
RelativePath="dep\src\SDL\video\SDL_blit_A.h">
</File>
<File
RelativePath="dep\src\SDL\video\SDL_blit_N.c">
</File>
<File
RelativePath="dep\src\SDL\video\SDL_bmp.c">
</File>
<File
RelativePath="dep\src\SDL\cdrom\SDL_cdrom.c">
</File>
<File
RelativePath="dep\src\SDL\cpuinfo\SDL_cpuinfo.c">
</File>
<File
RelativePath="dep\src\SDL\video\SDL_cursor.c">
</File>
<File
RelativePath="dep\src\SDL\video\SDL_cursor_c.h">
</File>
<File
RelativePath="dep\src\SDL\audio\windib\SDL_dibaudio.c">
</File>
<File
RelativePath="dep\src\SDL\audio\windib\SDL_dibaudio.h">
</File>
<File
RelativePath="dep\src\SDL\video\windib\SDL_dibevents.c">
</File>
<File
RelativePath="dep\src\SDL\video\windib\SDL_dibevents_c.h">
</File>
<File
RelativePath="dep\src\SDL\video\windib\SDL_dibvideo.c">
</File>
<File
RelativePath="dep\src\SDL\video\windib\SDL_dibvideo.h">
</File>
<File
RelativePath="dep\src\SDL\audio\disk\SDL_diskaudio.c">
</File>
<File
RelativePath="dep\src\SDL\audio\disk\SDL_diskaudio.h">
</File>
<File
RelativePath="dep\src\SDL\audio\dummy\SDL_dummyaudio.c">
</File>
<File
RelativePath="dep\src\SDL\audio\dummy\SDL_dummyaudio.h">
</File>
<File
RelativePath="dep\src\SDL\audio\windx5\SDL_dx5audio.c">
</File>
<File
RelativePath="dep\src\SDL\audio\windx5\SDL_dx5audio.h">
</File>
<File
RelativePath="dep\src\SDL\video\Windx5\SDL_dx5events.c">
</File>
<File
RelativePath="dep\src\SDL\video\Windx5\SDL_dx5events_c.h">
</File>
<File
RelativePath="dep\src\SDL\video\Windx5\SDL_dx5video.c">
</File>
<File
RelativePath="dep\src\SDL\video\Windx5\SDL_dx5video.h">
</File>
<File
RelativePath="dep\src\SDL\video\windx5\SDL_dx5yuv.c">
</File>
<File
RelativePath="dep\src\SDL\video\windx5\SDL_dx5yuv_c.h">
</File>
<File
RelativePath="dep\src\SDL\SDL_error.c">
</File>
<File
RelativePath="dep\src\SDL\SDL_error_c.h">
</File>
<File
RelativePath="dep\src\SDL\events\SDL_events.c">
</File>
<File
RelativePath="dep\src\SDL\events\SDL_events_c.h">
</File>
<File
RelativePath="dep\src\SDL\events\SDL_expose.c">
</File>
<File
RelativePath="dep\src\SDL\SDL_fatal.c">
</File>
<File
RelativePath="dep\src\SDL\SDL_fatal.h">
</File>
<File
RelativePath="dep\src\SDL\video\SDL_gamma.c">
</File>
<File
RelativePath="dep\src\SDL\stdlib\SDL_getenv.c">
</File>
<File
RelativePath="dep\src\SDL\stdlib\SDL_iconv.c">
</File>
<File
RelativePath="dep\src\SDL\joystick\SDL_joystick.c">
</File>
<File
RelativePath="dep\src\SDL\joystick\SDL_joystick_c.h">
</File>
<File
RelativePath="dep\src\SDL\events\SDL_keyboard.c">
</File>
<File
RelativePath="dep\src\SDL\video\SDL_leaks.h">
</File>
<File
RelativePath="dep\src\SDL\video\wincommon\SDL_lowvideo.h">
</File>
<File
RelativePath="dep\src\SDL\stdlib\SDL_malloc.c">
</File>
<File
RelativePath="dep\src\SDL\audio\SDL_mixer.c">
</File>
<File
RelativePath="dep\src\SDL\audio\SDL_mixer_MMX_VC.c">
</File>
<File
RelativePath="dep\src\SDL\joystick\win32\SDL_mmjoystick.c">
</File>
<File
RelativePath="dep\src\SDL\events\SDL_mouse.c">
</File>
<File
RelativePath="dep\src\SDL\video\dummy\SDL_nullevents.c">
</File>
<File
RelativePath="dep\src\SDL\video\dummy\SDL_nullevents_c.h">
</File>
<File
RelativePath="dep\src\SDL\video\dummy\SDL_nullmouse.c">
</File>
<File
RelativePath="dep\src\SDL\video\dummy\SDL_nullmouse_c.h">
</File>
<File
RelativePath="dep\src\SDL\video\dummy\SDL_nullvideo.c">
</File>
<File
RelativePath="dep\src\SDL\video\dummy\SDL_nullvideo.h">
</File>
<File
RelativePath="dep\src\SDL\video\SDL_pixels.c">
</File>
<File
RelativePath="dep\src\SDL\video\SDL_pixels_c.h">
</File>
<File
RelativePath="dep\src\SDL\stdlib\SDL_qsort.c">
</File>
<File
RelativePath="dep\src\SDL\events\SDL_quit.c">
</File>
<File
RelativePath="dep\src\SDL\events\SDL_resize.c">
</File>
<File
RelativePath="dep\src\SDL\video\SDL_RLEaccel.c">
</File>
<File
RelativePath="dep\src\SDL\video\SDL_RLEaccel_c.h">
</File>
<File
RelativePath="dep\src\SDL\file\SDL_rwops.c">
</File>
<File
RelativePath="dep\src\SDL\stdlib\SDL_stdlib.c">
</File>
<File
RelativePath="dep\src\SDL\video\SDL_stretch.c">
</File>
<File
RelativePath="dep\src\SDL\video\SDL_stretch_c.h">
</File>
<File
RelativePath="dep\src\SDL\stdlib\SDL_string.c">
</File>
<File
RelativePath="dep\src\SDL\video\SDL_surface.c">
</File>
<File
RelativePath="dep\src\SDL\audio\SDL_sysaudio.h">
</File>
<File
RelativePath="dep\src\SDL\cdrom\win32\SDL_syscdrom.c">
</File>
<File
RelativePath="dep\src\SDL\cdrom\SDL_syscdrom.h">
</File>
<File
RelativePath="dep\src\SDL\thread\generic\SDL_syscond.c">
</File>
<File
RelativePath="dep\src\SDL\video\wincommon\SDL_sysevents.c">
</File>
<File
RelativePath="dep\src\SDL\events\SDL_sysevents.h">
</File>
<File
RelativePath="dep\src\SDL\joystick\SDL_sysjoystick.h">
</File>
<File
RelativePath="dep\src\SDL\loadso\win32\SDL_sysloadso.c">
</File>
<File
RelativePath="dep\src\SDL\video\wincommon\SDL_sysmouse.c">
</File>
<File
RelativePath="dep\src\SDL\video\wincommon\SDL_sysmouse_c.h">
</File>
<File
RelativePath="dep\src\SDL\thread\win32\SDL_sysmutex.c">
</File>
<File
RelativePath="dep\src\SDL\thread\win32\SDL_syssem.c">
</File>
<File
RelativePath="dep\src\SDL\thread\win32\SDL_systhread.c">
</File>
<File
RelativePath="dep\src\SDL\thread\SDL_systhread.h">
</File>
<File
RelativePath="dep\src\SDL\thread\win32\SDL_systhread_c.h">
</File>
<File
RelativePath="dep\src\SDL\timer\win32\SDL_systimer.c">
</File>
<File
RelativePath="dep\src\SDL\timer\SDL_systimer.h">
</File>
<File
RelativePath="dep\src\SDL\video\SDL_sysvideo.h">
</File>
<File
RelativePath="dep\src\SDL\video\wincommon\SDL_syswm.c">
</File>
<File
RelativePath="dep\src\SDL\video\wincommon\SDL_syswm_c.h">
</File>
<File
RelativePath="dep\src\SDL\thread\SDL_thread.c">
</File>
<File
RelativePath="dep\src\SDL\thread\SDL_thread_c.h">
</File>
<File
RelativePath="dep\src\SDL\timer\SDL_timer.c">
</File>
<File
RelativePath="dep\src\SDL\timer\SDL_timer_c.h">
</File>
<File
RelativePath="dep\src\SDL\video\SDL_video.c">
</File>
<File
RelativePath="dep\src\SDL\video\windib\SDL_vkeys.h">
</File>
<File
RelativePath="dep\src\SDL\audio\SDL_wave.c">
</File>
<File
RelativePath="dep\src\SDL\audio\SDL_wave.h">
</File>
<File
RelativePath="dep\src\SDL\video\wincommon\SDL_wingl.c">
</File>
<File
RelativePath="dep\src\SDL\video\wincommon\SDL_wingl_c.h">
</File>
<File
RelativePath="dep\src\SDL\video\SDL_yuv.c">
</File>
<File
RelativePath="dep\src\SDL\video\SDL_yuv_sw.c">
</File>
<File
RelativePath="dep\src\SDL\video\SDL_yuv_sw_c.h">
</File>
<File
RelativePath="dep\src\SDL\video\SDL_yuvfuncs.h">
</File>
<File
RelativePath="dep\src\SDL\video\wincommon\Wmmsg.h">
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -1,94 +0,0 @@
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/* Main include header for the SDL library */
#ifndef _SDL_H
#define _SDL_H
#include "SDL_main.h"
#include "SDL_stdinc.h"
#include "SDL_audio.h"
#include "SDL_cdrom.h"
#include "SDL_cpuinfo.h"
#include "SDL_endian.h"
#include "SDL_error.h"
#include "SDL_events.h"
#include "SDL_loadso.h"
#include "SDL_mutex.h"
#include "SDL_rwops.h"
#include "SDL_thread.h"
#include "SDL_timer.h"
#include "SDL_video.h"
#include "SDL_version.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
/* As of version 0.5, SDL is loaded dynamically into the application */
/* These are the flags which may be passed to SDL_Init() -- you should
specify the subsystems which you will be using in your application.
*/
#define SDL_INIT_TIMER 0x00000001
#define SDL_INIT_AUDIO 0x00000010
#define SDL_INIT_VIDEO 0x00000020
#define SDL_INIT_CDROM 0x00000100
#define SDL_INIT_JOYSTICK 0x00000200
#define SDL_INIT_NOPARACHUTE 0x00100000 /* Don't catch fatal signals */
#define SDL_INIT_EVENTTHREAD 0x01000000 /* Not supported on all OS's */
#define SDL_INIT_EVERYTHING 0x0000FFFF
/* This function loads the SDL dynamically linked library and initializes
* the subsystems specified by 'flags' (and those satisfying dependencies)
* Unless the SDL_INIT_NOPARACHUTE flag is set, it will install cleanup
* signal handlers for some commonly ignored fatal signals (like SIGSEGV)
*/
extern DECLSPEC int SDLCALL SDL_Init(Uint32 flags);
/* This function initializes specific SDL subsystems */
extern DECLSPEC int SDLCALL SDL_InitSubSystem(Uint32 flags);
/* This function cleans up specific SDL subsystems */
extern DECLSPEC void SDLCALL SDL_QuitSubSystem(Uint32 flags);
/* This function returns mask of the specified subsystems which have
been initialized.
If 'flags' is 0, it returns a mask of all initialized subsystems.
*/
extern DECLSPEC Uint32 SDLCALL SDL_WasInit(Uint32 flags);
/* This function cleans up all initialized subsystems and unloads the
* dynamically linked library. You should call it upon all exit conditions.
*/
extern DECLSPEC void SDLCALL SDL_Quit(void);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif /* _SDL_H */

View File

@ -1,58 +0,0 @@
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/* Include file for SDL application focus event handling */
#ifndef _SDL_active_h
#define _SDL_active_h
#include "SDL_stdinc.h"
#include "SDL_error.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
/* The available application states */
#define SDL_APPMOUSEFOCUS 0x01 /* The app has mouse coverage */
#define SDL_APPINPUTFOCUS 0x02 /* The app has input focus */
#define SDL_APPACTIVE 0x04 /* The application is active */
/* Function prototypes */
/*
* This function returns the current state of the application, which is a
* bitwise combination of SDL_APPMOUSEFOCUS, SDL_APPINPUTFOCUS, and
* SDL_APPACTIVE. If SDL_APPACTIVE is set, then the user is able to
* see your application, otherwise it has been iconified or disabled.
*/
extern DECLSPEC Uint8 SDLCALL SDL_GetAppState(void);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif /* _SDL_active_h */

View File

@ -1,253 +0,0 @@
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/* Access to the raw audio mixing buffer for the SDL library */
#ifndef _SDL_audio_h
#define _SDL_audio_h
#include "SDL_stdinc.h"
#include "SDL_error.h"
#include "SDL_endian.h"
#include "SDL_mutex.h"
#include "SDL_thread.h"
#include "SDL_rwops.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
/* The calculated values in this structure are calculated by SDL_OpenAudio() */
typedef struct SDL_AudioSpec {
int freq; /* DSP frequency -- samples per second */
Uint16 format; /* Audio data format */
Uint8 channels; /* Number of channels: 1 mono, 2 stereo */
Uint8 silence; /* Audio buffer silence value (calculated) */
Uint16 samples; /* Audio buffer size in samples (power of 2) */
Uint16 padding; /* Necessary for some compile environments */
Uint32 size; /* Audio buffer size in bytes (calculated) */
/* This function is called when the audio device needs more data.
'stream' is a pointer to the audio data buffer
'len' is the length of that buffer in bytes.
Once the callback returns, the buffer will no longer be valid.
Stereo samples are stored in a LRLRLR ordering.
*/
void (SDLCALL *callback)(void *userdata, Uint8 *stream, int len);
void *userdata;
} SDL_AudioSpec;
/* Audio format flags (defaults to LSB byte order) */
#define AUDIO_U8 0x0008 /* Unsigned 8-bit samples */
#define AUDIO_S8 0x8008 /* Signed 8-bit samples */
#define AUDIO_U16LSB 0x0010 /* Unsigned 16-bit samples */
#define AUDIO_S16LSB 0x8010 /* Signed 16-bit samples */
#define AUDIO_U16MSB 0x1010 /* As above, but big-endian byte order */
#define AUDIO_S16MSB 0x9010 /* As above, but big-endian byte order */
#define AUDIO_U16 AUDIO_U16LSB
#define AUDIO_S16 AUDIO_S16LSB
/* Native audio byte ordering */
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
#define AUDIO_U16SYS AUDIO_U16LSB
#define AUDIO_S16SYS AUDIO_S16LSB
#else
#define AUDIO_U16SYS AUDIO_U16MSB
#define AUDIO_S16SYS AUDIO_S16MSB
#endif
/* A structure to hold a set of audio conversion filters and buffers */
typedef struct SDL_AudioCVT {
int needed; /* Set to 1 if conversion possible */
Uint16 src_format; /* Source audio format */
Uint16 dst_format; /* Target audio format */
double rate_incr; /* Rate conversion increment */
Uint8 *buf; /* Buffer to hold entire audio data */
int len; /* Length of original audio buffer */
int len_cvt; /* Length of converted audio buffer */
int len_mult; /* buffer must be len*len_mult big */
double len_ratio; /* Given len, final size is len*len_ratio */
void (SDLCALL *filters[10])(struct SDL_AudioCVT *cvt, Uint16 format);
int filter_index; /* Current audio conversion function */
} SDL_AudioCVT;
/* Function prototypes */
/* These functions are used internally, and should not be used unless you
* have a specific need to specify the audio driver you want to use.
* You should normally use SDL_Init() or SDL_InitSubSystem().
*/
extern DECLSPEC int SDLCALL SDL_AudioInit(const char *driver_name);
extern DECLSPEC void SDLCALL SDL_AudioQuit(void);
/* This function fills the given character buffer with the name of the
* current audio driver, and returns a pointer to it if the audio driver has
* been initialized. It returns NULL if no driver has been initialized.
*/
extern DECLSPEC char * SDLCALL SDL_AudioDriverName(char *namebuf, int maxlen);
/*
* This function opens the audio device with the desired parameters, and
* returns 0 if successful, placing the actual hardware parameters in the
* structure pointed to by 'obtained'. If 'obtained' is NULL, the audio
* data passed to the callback function will be guaranteed to be in the
* requested format, and will be automatically converted to the hardware
* audio format if necessary. This function returns -1 if it failed
* to open the audio device, or couldn't set up the audio thread.
*
* When filling in the desired audio spec structure,
* 'desired->freq' should be the desired audio frequency in samples-per-second.
* 'desired->format' should be the desired audio format.
* 'desired->samples' is the desired size of the audio buffer, in samples.
* This number should be a power of two, and may be adjusted by the audio
* driver to a value more suitable for the hardware. Good values seem to
* range between 512 and 8096 inclusive, depending on the application and
* CPU speed. Smaller values yield faster response time, but can lead
* to underflow if the application is doing heavy processing and cannot
* fill the audio buffer in time. A stereo sample consists of both right
* and left channels in LR ordering.
* Note that the number of samples is directly related to time by the
* following formula: ms = (samples*1000)/freq
* 'desired->size' is the size in bytes of the audio buffer, and is
* calculated by SDL_OpenAudio().
* 'desired->silence' is the value used to set the buffer to silence,
* and is calculated by SDL_OpenAudio().
* 'desired->callback' should be set to a function that will be called
* when the audio device is ready for more data. It is passed a pointer
* to the audio buffer, and the length in bytes of the audio buffer.
* This function usually runs in a separate thread, and so you should
* protect data structures that it accesses by calling SDL_LockAudio()
* and SDL_UnlockAudio() in your code.
* 'desired->userdata' is passed as the first parameter to your callback
* function.
*
* The audio device starts out playing silence when it's opened, and should
* be enabled for playing by calling SDL_PauseAudio(0) when you are ready
* for your audio callback function to be called. Since the audio driver
* may modify the requested size of the audio buffer, you should allocate
* any local mixing buffers after you open the audio device.
*/
extern DECLSPEC int SDLCALL SDL_OpenAudio(SDL_AudioSpec *desired, SDL_AudioSpec *obtained);
/*
* Get the current audio state:
*/
typedef enum {
SDL_AUDIO_STOPPED = 0,
SDL_AUDIO_PLAYING,
SDL_AUDIO_PAUSED
} SDL_audiostatus;
extern DECLSPEC SDL_audiostatus SDLCALL SDL_GetAudioStatus(void);
/*
* This function pauses and unpauses the audio callback processing.
* It should be called with a parameter of 0 after opening the audio
* device to start playing sound. This is so you can safely initialize
* data for your callback function after opening the audio device.
* Silence will be written to the audio device during the pause.
*/
extern DECLSPEC void SDLCALL SDL_PauseAudio(int pause_on);
/*
* This function loads a WAVE from the data source, automatically freeing
* that source if 'freesrc' is non-zero. For example, to load a WAVE file,
* you could do:
* SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav", "rb"), 1, ...);
*
* If this function succeeds, it returns the given SDL_AudioSpec,
* filled with the audio data format of the wave data, and sets
* 'audio_buf' to a malloc()'d buffer containing the audio data,
* and sets 'audio_len' to the length of that audio buffer, in bytes.
* You need to free the audio buffer with SDL_FreeWAV() when you are
* done with it.
*
* This function returns NULL and sets the SDL error message if the
* wave file cannot be opened, uses an unknown data format, or is
* corrupt. Currently raw and MS-ADPCM WAVE files are supported.
*/
extern DECLSPEC SDL_AudioSpec * SDLCALL SDL_LoadWAV_RW(SDL_RWops *src, int freesrc, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len);
/* Compatibility convenience function -- loads a WAV from a file */
#define SDL_LoadWAV(file, spec, audio_buf, audio_len) \
SDL_LoadWAV_RW(SDL_RWFromFile(file, "rb"),1, spec,audio_buf,audio_len)
/*
* This function frees data previously allocated with SDL_LoadWAV_RW()
*/
extern DECLSPEC void SDLCALL SDL_FreeWAV(Uint8 *audio_buf);
/*
* This function takes a source format and rate and a destination format
* and rate, and initializes the 'cvt' structure with information needed
* by SDL_ConvertAudio() to convert a buffer of audio data from one format
* to the other.
* This function returns 0, or -1 if there was an error.
*/
extern DECLSPEC int SDLCALL SDL_BuildAudioCVT(SDL_AudioCVT *cvt,
Uint16 src_format, Uint8 src_channels, int src_rate,
Uint16 dst_format, Uint8 dst_channels, int dst_rate);
/* Once you have initialized the 'cvt' structure using SDL_BuildAudioCVT(),
* created an audio buffer cvt->buf, and filled it with cvt->len bytes of
* audio data in the source format, this function will convert it in-place
* to the desired format.
* The data conversion may expand the size of the audio data, so the buffer
* cvt->buf should be allocated after the cvt structure is initialized by
* SDL_BuildAudioCVT(), and should be cvt->len*cvt->len_mult bytes long.
*/
extern DECLSPEC int SDLCALL SDL_ConvertAudio(SDL_AudioCVT *cvt);
/*
* This takes two audio buffers of the playing audio format and mixes
* them, performing addition, volume adjustment, and overflow clipping.
* The volume ranges from 0 - 128, and should be set to SDL_MIX_MAXVOLUME
* for full audio volume. Note this does not change hardware volume.
* This is provided for convenience -- you can mix your own audio data.
*/
#define SDL_MIX_MAXVOLUME 128
extern DECLSPEC void SDLCALL SDL_MixAudio(Uint8 *dst, const Uint8 *src, Uint32 len, int volume);
/*
* The lock manipulated by these functions protects the callback function.
* During a LockAudio/UnlockAudio pair, you can be guaranteed that the
* callback function is not running. Do not call these from the callback
* function or you will cause deadlock.
*/
extern DECLSPEC void SDLCALL SDL_LockAudio(void);
extern DECLSPEC void SDLCALL SDL_UnlockAudio(void);
/*
* This function shuts down audio processing and closes the audio device.
*/
extern DECLSPEC void SDLCALL SDL_CloseAudio(void);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif /* _SDL_audio_h */

View File

@ -1,24 +0,0 @@
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/* DEPRECATED */
#include "SDL_endian.h"

View File

@ -1,171 +0,0 @@
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/* This is the CD-audio control API for Simple DirectMedia Layer */
#ifndef _SDL_cdrom_h
#define _SDL_cdrom_h
#include "SDL_stdinc.h"
#include "SDL_error.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
/* In order to use these functions, SDL_Init() must have been called
with the SDL_INIT_CDROM flag. This causes SDL to scan the system
for CD-ROM drives, and load appropriate drivers.
*/
/* The maximum number of CD-ROM tracks on a disk */
#define SDL_MAX_TRACKS 99
/* The types of CD-ROM track possible */
#define SDL_AUDIO_TRACK 0x00
#define SDL_DATA_TRACK 0x04
/* The possible states which a CD-ROM drive can be in. */
typedef enum {
CD_TRAYEMPTY,
CD_STOPPED,
CD_PLAYING,
CD_PAUSED,
CD_ERROR = -1
} CDstatus;
/* Given a status, returns true if there's a disk in the drive */
#define CD_INDRIVE(status) ((int)(status) > 0)
typedef struct SDL_CDtrack {
Uint8 id; /* Track number */
Uint8 type; /* Data or audio track */
Uint16 unused;
Uint32 length; /* Length, in frames, of this track */
Uint32 offset; /* Offset, in frames, from start of disk */
} SDL_CDtrack;
/* This structure is only current as of the last call to SDL_CDStatus() */
typedef struct SDL_CD {
int id; /* Private drive identifier */
CDstatus status; /* Current drive status */
/* The rest of this structure is only valid if there's a CD in drive */
int numtracks; /* Number of tracks on disk */
int cur_track; /* Current track position */
int cur_frame; /* Current frame offset within current track */
SDL_CDtrack track[SDL_MAX_TRACKS+1];
} SDL_CD;
/* Conversion functions from frames to Minute/Second/Frames and vice versa */
#define CD_FPS 75
#define FRAMES_TO_MSF(f, M,S,F) { \
int value = f; \
*(F) = value%CD_FPS; \
value /= CD_FPS; \
*(S) = value%60; \
value /= 60; \
*(M) = value; \
}
#define MSF_TO_FRAMES(M, S, F) ((M)*60*CD_FPS+(S)*CD_FPS+(F))
/* CD-audio API functions: */
/* Returns the number of CD-ROM drives on the system, or -1 if
SDL_Init() has not been called with the SDL_INIT_CDROM flag.
*/
extern DECLSPEC int SDLCALL SDL_CDNumDrives(void);
/* Returns a human-readable, system-dependent identifier for the CD-ROM.
Example:
"/dev/cdrom"
"E:"
"/dev/disk/ide/1/master"
*/
extern DECLSPEC const char * SDLCALL SDL_CDName(int drive);
/* Opens a CD-ROM drive for access. It returns a drive handle on success,
or NULL if the drive was invalid or busy. This newly opened CD-ROM
becomes the default CD used when other CD functions are passed a NULL
CD-ROM handle.
Drives are numbered starting with 0. Drive 0 is the system default CD-ROM.
*/
extern DECLSPEC SDL_CD * SDLCALL SDL_CDOpen(int drive);
/* This function returns the current status of the given drive.
If the drive has a CD in it, the table of contents of the CD and current
play position of the CD will be stored in the SDL_CD structure.
*/
extern DECLSPEC CDstatus SDLCALL SDL_CDStatus(SDL_CD *cdrom);
/* Play the given CD starting at 'start_track' and 'start_frame' for 'ntracks'
tracks and 'nframes' frames. If both 'ntrack' and 'nframe' are 0, play
until the end of the CD. This function will skip data tracks.
This function should only be called after calling SDL_CDStatus() to
get track information about the CD.
For example:
// Play entire CD:
if ( CD_INDRIVE(SDL_CDStatus(cdrom)) )
SDL_CDPlayTracks(cdrom, 0, 0, 0, 0);
// Play last track:
if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) {
SDL_CDPlayTracks(cdrom, cdrom->numtracks-1, 0, 0, 0);
}
// Play first and second track and 10 seconds of third track:
if ( CD_INDRIVE(SDL_CDStatus(cdrom)) )
SDL_CDPlayTracks(cdrom, 0, 0, 2, 10);
This function returns 0, or -1 if there was an error.
*/
extern DECLSPEC int SDLCALL SDL_CDPlayTracks(SDL_CD *cdrom,
int start_track, int start_frame, int ntracks, int nframes);
/* Play the given CD starting at 'start' frame for 'length' frames.
It returns 0, or -1 if there was an error.
*/
extern DECLSPEC int SDLCALL SDL_CDPlay(SDL_CD *cdrom, int start, int length);
/* Pause play -- returns 0, or -1 on error */
extern DECLSPEC int SDLCALL SDL_CDPause(SDL_CD *cdrom);
/* Resume play -- returns 0, or -1 on error */
extern DECLSPEC int SDLCALL SDL_CDResume(SDL_CD *cdrom);
/* Stop play -- returns 0, or -1 on error */
extern DECLSPEC int SDLCALL SDL_CDStop(SDL_CD *cdrom);
/* Eject CD-ROM -- returns 0, or -1 on error */
extern DECLSPEC int SDLCALL SDL_CDEject(SDL_CD *cdrom);
/* Closes the handle for the CD-ROM drive */
extern DECLSPEC void SDLCALL SDL_CDClose(SDL_CD *cdrom);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif /* _SDL_video_h */

View File

@ -1,45 +0,0 @@
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#ifndef _SDL_config_h
#define _SDL_config_h
#include "SDL_platform.h"
/* Add any platform that doesn't build using the configure system */
#if defined(__AMIGA__)
#include "SDL_config_amiga.h"
#elif defined(__DREAMCAST__)
#include "SDL_config_dreamcast.h"
#elif defined(__MACOS__)
#include "SDL_config_macos.h"
#elif defined(__MACOSX__)
#include "SDL_config_macosx.h"
#elif defined(__WIN32__)
#include "SDL_config_win32.h"
#elif defined(__OS2__)
#include "SDL_config_os2.h"
#else
#include "SDL_config_minimal.h"
#endif /* platform config */
#endif /* _SDL_config_h */

View File

@ -1,45 +0,0 @@
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#ifndef _SDL_config_h
#define _SDL_config_h
#include "SDL_platform.h"
/* Add any platform that doesn't build using the configure system */
#if defined(__AMIGA__)
#include "SDL_config_amiga.h"
#elif defined(__DREAMCAST__)
#include "SDL_config_dreamcast.h"
#elif defined(__MACOS__)
#include "SDL_config_macos.h"
#elif defined(__MACOSX__)
#include "SDL_config_macosx.h"
#elif defined(__WIN32__)
#include "SDL_config_win32.h"
#elif defined(__OS2__)
#include "SDL_config_os2.h"
#else
#include "SDL_config_minimal.h"
#endif /* platform config */
#endif /* _SDL_config_h */

View File

@ -1,305 +0,0 @@
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#ifndef _SDL_config_h
#define _SDL_config_h
/* This is a set of defines to configure the SDL features */
/* General platform specific identifiers */
#include "SDL_platform.h"
/* C language features */
#undef const
#undef inline
#undef volatile
/* C datatypes */
#undef size_t
#undef int8_t
#undef uint8_t
#undef int16_t
#undef uint16_t
#undef int32_t
#undef uint32_t
#undef int64_t
#undef uint64_t
#undef uintptr_t
#undef SDL_HAS_64BIT_TYPE
/* Endianness */
#undef SDL_BYTEORDER
/* Comment this if you want to build without any C library requirements */
#undef HAVE_LIBC
#if HAVE_LIBC
/* Useful headers */
#undef HAVE_ALLOCA_H
#undef HAVE_SYS_TYPES_H
#undef HAVE_STDIO_H
#undef STDC_HEADERS
#undef HAVE_STDLIB_H
#undef HAVE_STDARG_H
#undef HAVE_MALLOC_H
#undef HAVE_MEMORY_H
#undef HAVE_STRING_H
#undef HAVE_STRINGS_H
#undef HAVE_INTTYPES_H
#undef HAVE_STDINT_H
#undef HAVE_CTYPE_H
#undef HAVE_MATH_H
#undef HAVE_ICONV_H
#undef HAVE_SIGNAL_H
#undef HAVE_ALTIVEC_H
/* C library functions */
#undef HAVE_MALLOC
#undef HAVE_CALLOC
#undef HAVE_REALLOC
#undef HAVE_FREE
#undef HAVE_ALLOCA
#ifndef _WIN32 /* Don't use C runtime versions of these on Windows */
#undef HAVE_GETENV
#undef HAVE_PUTENV
#undef HAVE_UNSETENV
#endif
#undef HAVE_QSORT
#undef HAVE_ABS
#undef HAVE_BCOPY
#undef HAVE_MEMSET
#undef HAVE_MEMCPY
#undef HAVE_MEMMOVE
#undef HAVE_MEMCMP
#undef HAVE_STRLEN
#undef HAVE_STRLCPY
#undef HAVE_STRLCAT
#undef HAVE_STRDUP
#undef HAVE__STRREV
#undef HAVE__STRUPR
#undef HAVE__STRLWR
#undef HAVE_INDEX
#undef HAVE_RINDEX
#undef HAVE_STRCHR
#undef HAVE_STRRCHR
#undef HAVE_STRSTR
#undef HAVE_ITOA
#undef HAVE__LTOA
#undef HAVE__UITOA
#undef HAVE__ULTOA
#undef HAVE_STRTOL
#undef HAVE_STRTOUL
#undef HAVE__I64TOA
#undef HAVE__UI64TOA
#undef HAVE_STRTOLL
#undef HAVE_STRTOULL
#undef HAVE_STRTOD
#undef HAVE_ATOI
#undef HAVE_ATOF
#undef HAVE_STRCMP
#undef HAVE_STRNCMP
#undef HAVE__STRICMP
#undef HAVE_STRCASECMP
#undef HAVE__STRNICMP
#undef HAVE_STRNCASECMP
#undef HAVE_SSCANF
#undef HAVE_SNPRINTF
#undef HAVE_VSNPRINTF
#undef HAVE_ICONV
#undef HAVE_SIGACTION
#undef HAVE_SETJMP
#undef HAVE_NANOSLEEP
#undef HAVE_CLOCK_GETTIME
#undef HAVE_DLVSYM
#else
/* We may need some replacement for stdarg.h here */
#include <stdarg.h>
#endif /* HAVE_LIBC */
/* Allow disabling of core subsystems */
#undef SDL_AUDIO_DISABLED
#undef SDL_CDROM_DISABLED
#undef SDL_CPUINFO_DISABLED
#undef SDL_EVENTS_DISABLED
#undef SDL_FILE_DISABLED
#undef SDL_JOYSTICK_DISABLED
#undef SDL_LOADSO_DISABLED
#undef SDL_THREADS_DISABLED
#undef SDL_TIMERS_DISABLED
#undef SDL_VIDEO_DISABLED
/* Enable various audio drivers */
#undef SDL_AUDIO_DRIVER_AHI
#undef SDL_AUDIO_DRIVER_ALSA
#undef SDL_AUDIO_DRIVER_ALSA_DYNAMIC
#undef SDL_AUDIO_DRIVER_ARTS
#undef SDL_AUDIO_DRIVER_ARTS_DYNAMIC
#undef SDL_AUDIO_DRIVER_BAUDIO
#undef SDL_AUDIO_DRIVER_BSD
#undef SDL_AUDIO_DRIVER_COREAUDIO
#undef SDL_AUDIO_DRIVER_DART
#undef SDL_AUDIO_DRIVER_DC
#undef SDL_AUDIO_DRIVER_DISK
#undef SDL_AUDIO_DRIVER_DUMMY
#undef SDL_AUDIO_DRIVER_DMEDIA
#undef SDL_AUDIO_DRIVER_DSOUND
#undef SDL_AUDIO_DRIVER_ESD
#undef SDL_AUDIO_DRIVER_ESD_DYNAMIC
#undef SDL_AUDIO_DRIVER_MINT
#undef SDL_AUDIO_DRIVER_MMEAUDIO
#undef SDL_AUDIO_DRIVER_NAS
#undef SDL_AUDIO_DRIVER_OSS
#undef SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H
#undef SDL_AUDIO_DRIVER_PAUD
#undef SDL_AUDIO_DRIVER_QNXNTO
#undef SDL_AUDIO_DRIVER_SNDMGR
#undef SDL_AUDIO_DRIVER_SUNAUDIO
#undef SDL_AUDIO_DRIVER_WAVEOUT
/* Enable various cdrom drivers */
#undef SDL_CDROM_AIX
#undef SDL_CDROM_BEOS
#undef SDL_CDROM_BSDI
#undef SDL_CDROM_DC
#undef SDL_CDROM_DUMMY
#undef SDL_CDROM_FREEBSD
#undef SDL_CDROM_LINUX
#undef SDL_CDROM_MACOS
#undef SDL_CDROM_MACOSX
#undef SDL_CDROM_MINT
#undef SDL_CDROM_OPENBSD
#undef SDL_CDROM_OS2
#undef SDL_CDROM_OSF
#undef SDL_CDROM_QNX
#undef SDL_CDROM_WIN32
/* Enable various input drivers */
#undef SDL_INPUT_TSLIB
#undef SDL_JOYSTICK_AMIGA
#undef SDL_JOYSTICK_BEOS
#undef SDL_JOYSTICK_DC
#undef SDL_JOYSTICK_DUMMY
#undef SDL_JOYSTICK_IOKIT
#undef SDL_JOYSTICK_LINUX
#undef SDL_JOYSTICK_LINUXEV
#undef SDL_JOYSTICK_MACOS
#undef SDL_JOYSTICK_MINT
#undef SDL_JOYSTICK_OS2
#undef SDL_JOYSTICK_RISCOS
#undef SDL_JOYSTICK_WINMM
#undef SDL_JOYSTICK_USBHID
#undef SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H
/* Enable various shared object loading systems */
#undef SDL_LOADSO_BEOS
#undef SDL_LOADSO_DLCOMPAT
#undef SDL_LOADSO_DLOPEN
#undef SDL_LOADSO_DUMMY
#undef SDL_LOADSO_LDG
#undef SDL_LOADSO_MACOS
#undef SDL_LOADSO_OS2
#undef SDL_LOADSO_WIN32
/* Enable various threading systems */
#undef SDL_THREAD_AMIGA
#undef SDL_THREAD_BEOS
#undef SDL_THREAD_DC
#undef SDL_THREAD_EPOC
#undef SDL_THREAD_OS2
#undef SDL_THREAD_PTH
#undef SDL_THREAD_PTHREAD
#undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX
#undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP
#undef SDL_THREAD_SPROC
#undef SDL_THREAD_WIN32
/* Enable various timer systems */
#undef SDL_TIMER_AMIGA
#undef SDL_TIMER_BEOS
#undef SDL_TIMER_DC
#undef SDL_TIMER_DUMMY
#undef SDL_TIMER_EPOC
#undef SDL_TIMER_MACOS
#undef SDL_TIMER_MINT
#undef SDL_TIMER_OS2
#undef SDL_TIMER_RISCOS
#undef SDL_TIMER_UNIX
#undef SDL_TIMER_WIN32
#undef SDL_TIMER_WINCE
/* Enable various video drivers */
#undef SDL_VIDEO_DRIVER_AALIB
#undef SDL_VIDEO_DRIVER_BWINDOW
#undef SDL_VIDEO_DRIVER_CYBERGRAPHICS
#undef SDL_VIDEO_DRIVER_DC
#undef SDL_VIDEO_DRIVER_DDRAW
#undef SDL_VIDEO_DRIVER_DGA
#undef SDL_VIDEO_DRIVER_DIRECTFB
#undef SDL_VIDEO_DRIVER_DRAWSPROCKET
#undef SDL_VIDEO_DRIVER_DUMMY
#undef SDL_VIDEO_DRIVER_EPOC
#undef SDL_VIDEO_DRIVER_FBCON
#undef SDL_VIDEO_DRIVER_GAPI
#undef SDL_VIDEO_DRIVER_GEM
#undef SDL_VIDEO_DRIVER_GGI
#undef SDL_VIDEO_DRIVER_IPOD
#undef SDL_VIDEO_DRIVER_NANOX
#undef SDL_VIDEO_DRIVER_OS2FS
#undef SDL_VIDEO_DRIVER_PHOTON
#undef SDL_VIDEO_DRIVER_PICOGUI
#undef SDL_VIDEO_DRIVER_PS2GS
#undef SDL_VIDEO_DRIVER_QTOPIA
#undef SDL_VIDEO_DRIVER_QUARTZ
#undef SDL_VIDEO_DRIVER_RISCOS
#undef SDL_VIDEO_DRIVER_SVGALIB
#undef SDL_VIDEO_DRIVER_TOOLBOX
#undef SDL_VIDEO_DRIVER_VGL
#undef SDL_VIDEO_DRIVER_WINDIB
#undef SDL_VIDEO_DRIVER_WSCONS
#undef SDL_VIDEO_DRIVER_X11
#undef SDL_VIDEO_DRIVER_X11_DGAMOUSE
#undef SDL_VIDEO_DRIVER_X11_DPMS
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER
#undef SDL_VIDEO_DRIVER_X11_VIDMODE
#undef SDL_VIDEO_DRIVER_X11_XINERAMA
#undef SDL_VIDEO_DRIVER_X11_XME
#undef SDL_VIDEO_DRIVER_X11_XRANDR
#undef SDL_VIDEO_DRIVER_X11_XV
#undef SDL_VIDEO_DRIVER_XBIOS
/* Enable OpenGL support */
#undef SDL_VIDEO_OPENGL
#undef SDL_VIDEO_OPENGL_GLX
#undef SDL_VIDEO_OPENGL_WGL
#undef SDL_VIDEO_OPENGL_OSMESA
#undef SDL_VIDEO_OPENGL_OSMESA_DYNAMIC
/* Enable assembly routines */
#undef SDL_ASSEMBLY_ROUTINES
#undef SDL_HERMES_BLITTERS
#undef SDL_ALTIVEC_BLITTERS
#endif /* _SDL_config_h */

View File

@ -1,80 +0,0 @@
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#ifndef _SDL_config_amiga_h
#define _SDL_config_amiga_h
#include "SDL_platform.h"
/* This is a set of defines to configure the SDL features */
#define SDL_HAS_64BIT_TYPE 1
/* Useful headers */
#define HAVE_SYS_TYPES_H 1
#define HAVE_STDIO_H 1
#define STDC_HEADERS 1
#define HAVE_STRING_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_SIGNAL_H 1
/* C library functions */
#define HAVE_MALLOC 1
#define HAVE_CALLOC 1
#define HAVE_REALLOC 1
#define HAVE_FREE 1
#define HAVE_ALLOCA 1
#define HAVE_GETENV 1
#define HAVE_PUTENV 1
#define HAVE_MEMSET 1
#define HAVE_MEMCPY 1
#define HAVE_MEMMOVE 1
#define HAVE_MEMCMP 1
/* Enable various audio drivers */
#define SDL_AUDIO_DRIVER_AHI 1
#define SDL_AUDIO_DRIVER_DISK 1
#define SDL_AUDIO_DRIVER_DUMMY 1
/* Enable various cdrom drivers */
#define SDL_CDROM_DUMMY 1
/* Enable various input drivers */
#define SDL_JOYSTICK_AMIGA 1
/* Enable various shared object loading systems */
#define SDL_LOADSO_DUMMY 1
/* Enable various threading systems */
#define SDL_THREAD_AMIGA 1
/* Enable various timer systems */
#define SDL_TIMER_AMIGA 1
/* Enable various video drivers */
#define SDL_VIDEO_DRIVER_CYBERGRAPHICS 1
#define SDL_VIDEO_DRIVER_DUMMY 1
/* Enable OpenGL support */
#define SDL_VIDEO_OPENGL 1
#endif /* _SDL_config_amiga_h */

View File

@ -1,106 +0,0 @@
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#ifndef _SDL_config_dreamcast_h
#define _SDL_config_dreamcast_h
#include "SDL_platform.h"
/* This is a set of defines to configure the SDL features */
typedef signed char int8_t;
typedef unsigned char uint8_t;
typedef signed short int16_t;
typedef unsigned short uint16_t;
typedef signed int int32_t;
typedef unsigned int uint32_t;
typedef signed long long int64_t;
typedef unsigned long long uint64_t;
typedef unsigned long uintptr_t;
#define SDL_HAS_64BIT_TYPE 1
/* Useful headers */
#define HAVE_SYS_TYPES_H 1
#define HAVE_STDIO_H 1
#define STDC_HEADERS 1
#define HAVE_STRING_H 1
#define HAVE_CTYPE_H 1
/* C library functions */
#define HAVE_MALLOC 1
#define HAVE_CALLOC 1
#define HAVE_REALLOC 1
#define HAVE_FREE 1
#define HAVE_ALLOCA 1
#define HAVE_GETENV 1
#define HAVE_PUTENV 1
#define HAVE_QSORT 1
#define HAVE_ABS 1
#define HAVE_BCOPY 1
#define HAVE_MEMSET 1
#define HAVE_MEMCPY 1
#define HAVE_MEMMOVE 1
#define HAVE_MEMCMP 1
#define HAVE_STRLEN 1
#define HAVE_STRDUP 1
#define HAVE_INDEX 1
#define HAVE_RINDEX 1
#define HAVE_STRCHR 1
#define HAVE_STRRCHR 1
#define HAVE_STRSTR 1
#define HAVE_STRTOL 1
#define HAVE_STRTOD 1
#define HAVE_ATOI 1
#define HAVE_ATOF 1
#define HAVE_STRCMP 1
#define HAVE_STRNCMP 1
#define HAVE_STRICMP 1
#define HAVE_STRCASECMP 1
#define HAVE_SSCANF 1
#define HAVE_SNPRINTF 1
#define HAVE_VSNPRINTF 1
/* Enable various audio drivers */
#define SDL_AUDIO_DRIVER_DC 1
#define SDL_AUDIO_DRIVER_DISK 1
#define SDL_AUDIO_DRIVER_DUMMY 1
/* Enable various cdrom drivers */
#define SDL_CDROM_DC 1
/* Enable various input drivers */
#define SDL_JOYSTICK_DC 1
/* Enable various shared object loading systems */
#define SDL_LOADSO_DUMMY 1
/* Enable various threading systems */
#define SDL_THREAD_DC 1
/* Enable various timer systems */
#define SDL_TIMER_DC 1
/* Enable various video drivers */
#define SDL_VIDEO_DRIVER_DC 1
#define SDL_VIDEO_DRIVER_DUMMY 1
#endif /* _SDL_config_dreamcast_h */

View File

@ -1,112 +0,0 @@
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#ifndef _SDL_config_macos_h
#define _SDL_config_macos_h
#include "SDL_platform.h"
/* This is a set of defines to configure the SDL features */
#include <MacTypes.h>
typedef SInt8 int8_t;
typedef UInt8 uint8_t;
typedef SInt16 int16_t;
typedef UInt16 uint16_t;
typedef SInt32 int32_t;
typedef UInt32 uint32_t;
typedef SInt64 int64_t;
typedef UInt64 uint64_t;
typedef unsigned long uintptr_t;
#define SDL_HAS_64BIT_TYPE 1
/* Useful headers */
#define HAVE_STDIO_H 1
#define STDC_HEADERS 1
#define HAVE_STRING_H 1
#define HAVE_CTYPE_H 1
#define HAVE_MATH_H 1
#define HAVE_SIGNAL_H 1
/* C library functions */
#define HAVE_MALLOC 1
#define HAVE_CALLOC 1
#define HAVE_REALLOC 1
#define HAVE_FREE 1
#define HAVE_ALLOCA 1
#define HAVE_ABS 1
#define HAVE_MEMSET 1
#define HAVE_MEMCPY 1
#define HAVE_MEMMOVE 1
#define HAVE_MEMCMP 1
#define HAVE_STRLEN 1
#define HAVE_STRCHR 1
#define HAVE_STRRCHR 1
#define HAVE_STRSTR 1
#define HAVE_ITOA 1
#define HAVE_STRTOL 1
#define HAVE_STRTOD 1
#define HAVE_ATOI 1
#define HAVE_ATOF 1
#define HAVE_STRCMP 1
#define HAVE_STRNCMP 1
#define HAVE_SSCANF 1
/* Enable various audio drivers */
#define SDL_AUDIO_DRIVER_SNDMGR 1
#define SDL_AUDIO_DRIVER_DISK 1
#define SDL_AUDIO_DRIVER_DUMMY 1
/* Enable various cdrom drivers */
#if TARGET_API_MAC_CARBON
#define SDL_CDROM_DUMMY 1
#else
#define SDL_CDROM_MACOS 1
#endif
/* Enable various input drivers */
#if TARGET_API_MAC_CARBON
#define SDL_JOYSTICK_DUMMY 1
#else
#define SDL_JOYSTICK_MACOS 1
#endif
/* Enable various shared object loading systems */
#define SDL_LOADSO_MACOS 1
/* Enable various threading systems */
#define SDL_THREADS_DISABLED 1
/* Enable various timer systems */
#define SDL_TIMER_MACOS 1
/* Enable various video drivers */
#define SDL_VIDEO_DRIVER_DUMMY 1
#define SDL_VIDEO_DRIVER_DRAWSPROCKET 1
#define SDL_VIDEO_DRIVER_TOOLBOX 1
/* Enable OpenGL support */
#define SDL_VIDEO_OPENGL 1
#endif /* _SDL_config_macos_h */

View File

@ -1,132 +0,0 @@
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#ifndef _SDL_config_macosx_h
#define _SDL_config_macosx_h
#include "SDL_platform.h"
/* This is a set of defines to configure the SDL features */
#define SDL_HAS_64BIT_TYPE 1
/* Useful headers */
/* If we specified an SDK or have a post-PowerPC chip, then alloca.h exists. */
#if ( (MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (!defined(__POWERPC__)) )
#define HAVE_ALLOCA_H 1
#endif
#define HAVE_SYS_TYPES_H 1
#define HAVE_STDIO_H 1
#define STDC_HEADERS 1
#define HAVE_STRING_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_STDINT_H 1
#define HAVE_CTYPE_H 1
#define HAVE_MATH_H 1
#define HAVE_SIGNAL_H 1
/* C library functions */
#define HAVE_MALLOC 1
#define HAVE_CALLOC 1
#define HAVE_REALLOC 1
#define HAVE_FREE 1
#define HAVE_ALLOCA 1
#define HAVE_GETENV 1
#define HAVE_PUTENV 1
#define HAVE_UNSETENV 1
#define HAVE_QSORT 1
#define HAVE_ABS 1
#define HAVE_BCOPY 1
#define HAVE_MEMSET 1
#define HAVE_MEMCPY 1
#define HAVE_MEMMOVE 1
#define HAVE_MEMCMP 1
#define HAVE_STRLEN 1
#define HAVE_STRLCPY 1
#define HAVE_STRLCAT 1
#define HAVE_STRDUP 1
#define HAVE_STRCHR 1
#define HAVE_STRRCHR 1
#define HAVE_STRSTR 1
#define HAVE_STRTOL 1
#define HAVE_STRTOUL 1
#define HAVE_STRTOLL 1
#define HAVE_STRTOULL 1
#define HAVE_STRTOD 1
#define HAVE_ATOI 1
#define HAVE_ATOF 1
#define HAVE_STRCMP 1
#define HAVE_STRNCMP 1
#define HAVE_STRCASECMP 1
#define HAVE_STRNCASECMP 1
#define HAVE_SSCANF 1
#define HAVE_SNPRINTF 1
#define HAVE_VSNPRINTF 1
#define HAVE_SIGACTION 1
#define HAVE_SETJMP 1
#define HAVE_NANOSLEEP 1
/* Enable various audio drivers */
#define SDL_AUDIO_DRIVER_COREAUDIO 1
#define SDL_AUDIO_DRIVER_SNDMGR 1
#define SDL_AUDIO_DRIVER_DISK 1
#define SDL_AUDIO_DRIVER_DUMMY 1
/* Enable various cdrom drivers */
#define SDL_CDROM_MACOSX 1
/* Enable various input drivers */
#define SDL_JOYSTICK_IOKIT 1
/* Enable various shared object loading systems */
#ifdef __ppc__
/* For Mac OS X 10.2 compatibility */
#define SDL_LOADSO_DLCOMPAT 1
#else
#define SDL_LOADSO_DLOPEN 1
#endif
/* Enable various threading systems */
#define SDL_THREAD_PTHREAD 1
#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1
/* Enable various timer systems */
#define SDL_TIMER_UNIX 1
/* Enable various video drivers */
#define SDL_VIDEO_DRIVER_DUMMY 1
#if TARGET_API_MAC_CARBON
#define SDL_VIDEO_DRIVER_TOOLBOX 1
#else
#define SDL_VIDEO_DRIVER_QUARTZ 1
#endif
/* Enable OpenGL support */
#define SDL_VIDEO_OPENGL 1
/* Enable assembly routines */
#define SDL_ASSEMBLY_ROUTINES 1
#ifdef __ppc__
#define SDL_ALTIVEC_BLITTERS 1
#endif
#endif /* _SDL_config_macosx_h */

View File

@ -1,62 +0,0 @@
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#ifndef _SDL_config_minimal_h
#define _SDL_config_minimal_h
#include "SDL_platform.h"
/* This is the minimal configuration that can be used to build SDL */
#include <stdarg.h>
typedef signed char int8_t;
typedef unsigned char uint8_t;
typedef signed short int16_t;
typedef unsigned short uint16_t;
typedef signed int int32_t;
typedef unsigned int uint32_t;
typedef unsigned int size_t;
typedef unsigned long uintptr_t;
/* Enable the dummy audio driver (src/audio/dummy/\*.c) */
#define SDL_AUDIO_DRIVER_DUMMY 1
/* Enable the stub cdrom driver (src/cdrom/dummy/\*.c) */
#define SDL_CDROM_DISABLED 1
/* Enable the stub joystick driver (src/joystick/dummy/\*.c) */
#define SDL_JOYSTICK_DISABLED 1
/* Enable the stub shared object loader (src/loadso/dummy/\*.c) */
#define SDL_LOADSO_DISABLED 1
/* Enable the stub thread support (src/thread/generic/\*.c) */
#define SDL_THREADS_DISABLED 1
/* Enable the stub timer support (src/timer/dummy/\*.c) */
#define SDL_TIMERS_DISABLED 1
/* Enable the dummy video driver (src/video/dummy/\*.c) */
#define SDL_VIDEO_DRIVER_DUMMY 1
#endif /* _SDL_config_minimal_h */

View File

@ -1,141 +0,0 @@
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#ifndef _SDL_config_os2_h
#define _SDL_config_os2_h
#include "SDL_platform.h"
/* This is a set of defines to configure the SDL features */
typedef signed char int8_t;
typedef unsigned char uint8_t;
typedef signed short int16_t;
typedef unsigned short uint16_t;
typedef signed int int32_t;
typedef unsigned int uint32_t;
typedef unsigned int size_t;
typedef unsigned long uintptr_t;
typedef signed long long int64_t;
typedef unsigned long long uint64_t;
#define SDL_HAS_64BIT_TYPE 1
/* Use Watcom's LIBC */
#define HAVE_LIBC 1
/* Useful headers */
#define HAVE_SYS_TYPES_H 1
#define HAVE_STDIO_H 1
#define STDC_HEADERS 1
#define HAVE_STDLIB_H 1
#define HAVE_STDARG_H 1
#define HAVE_MALLOC_H 1
#define HAVE_MEMORY_H 1
#define HAVE_STRING_H 1
#define HAVE_STRINGS_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_STDINT_H 1
#define HAVE_CTYPE_H 1
#define HAVE_MATH_H 1
#define HAVE_SIGNAL_H 1
/* C library functions */
#define HAVE_MALLOC 1
#define HAVE_CALLOC 1
#define HAVE_REALLOC 1
#define HAVE_FREE 1
#define HAVE_ALLOCA 1
#define HAVE_GETENV 1
#define HAVE_PUTENV 1
#define HAVE_UNSETENV 1
#define HAVE_QSORT 1
#define HAVE_ABS 1
#define HAVE_BCOPY 1
#define HAVE_MEMSET 1
#define HAVE_MEMCPY 1
#define HAVE_MEMMOVE 1
#define HAVE_MEMCMP 1
#define HAVE_STRLEN 1
#define HAVE_STRLCPY 1
#define HAVE_STRLCAT 1
#define HAVE_STRDUP 1
#define HAVE__STRREV 1
#define HAVE__STRUPR 1
#define HAVE__STRLWR 1
#define HAVE_INDEX 1
#define HAVE_RINDEX 1
#define HAVE_STRCHR 1
#define HAVE_STRRCHR 1
#define HAVE_STRSTR 1
#define HAVE_ITOA 1
#define HAVE__LTOA 1
#define HAVE__UITOA 1
#define HAVE__ULTOA 1
#define HAVE_STRTOL 1
#define HAVE__I64TOA 1
#define HAVE__UI64TOA 1
#define HAVE_STRTOLL 1
#define HAVE_STRTOD 1
#define HAVE_ATOI 1
#define HAVE_ATOF 1
#define HAVE_STRCMP 1
#define HAVE_STRNCMP 1
#define HAVE_STRICMP 1
#define HAVE_STRCASECMP 1
#define HAVE_SSCANF 1
#define HAVE_SNPRINTF 1
#define HAVE_VSNPRINTF 1
#define HAVE_SETJMP 1
#define HAVE_CLOCK_GETTIME 1
/* Enable various audio drivers */
#define SDL_AUDIO_DRIVER_DART 1
#define SDL_AUDIO_DRIVER_DISK 1
#define SDL_AUDIO_DRIVER_DUMMY 1
/* Enable various cdrom drivers */
#define SDL_CDROM_OS2 1
/* Enable various input drivers */
#define SDL_JOYSTICK_OS2 1
/* Enable various shared object loading systems */
#define SDL_LOADSO_OS2 1
/* Enable various threading systems */
#define SDL_THREAD_OS2 1
/* Enable various timer systems */
#define SDL_TIMER_OS2 1
/* Enable various video drivers */
#define SDL_VIDEO_DRIVER_DUMMY 1
#define SDL_VIDEO_DRIVER_OS2FS 1
/* Enable OpenGL support */
/* Nothing here yet for OS/2... :( */
/* Enable assembly routines where available */
#define SDL_ASSEMBLY_ROUTINES 1
#endif /* _SDL_config_os2_h */

View File

@ -1,173 +0,0 @@
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#ifndef _SDL_config_win32_h
#define _SDL_config_win32_h
#include "SDL_platform.h"
/* This is a set of defines to configure the SDL features */
#ifdef __GNUC__
#define HAVE_STDINT_H 1
#elif defined(_MSC_VER)
typedef signed __int8 int8_t;
typedef unsigned __int8 uint8_t;
typedef signed __int16 int16_t;
typedef unsigned __int16 uint16_t;
typedef signed __int32 int32_t;
typedef unsigned __int32 uint32_t;
typedef signed __int64 int64_t;
typedef unsigned __int64 uint64_t;
#ifndef _UINTPTR_T_DEFINED
#ifdef _WIN64
typedef unsigned __int64 uintptr_t;
#else
typedef unsigned int uintptr_t;
#endif
#define _UINTPTR_T_DEFINED
#endif
#else /* !__GNUC__ && !_MSC_VER */
typedef signed char int8_t;
typedef unsigned char uint8_t;
typedef signed short int16_t;
typedef unsigned short uint16_t;
typedef signed int int32_t;
typedef unsigned int uint32_t;
typedef signed long long int64_t;
typedef unsigned long long uint64_t;
#ifndef _SIZE_T_DEFINED_
#define _SIZE_T_DEFINED_
typedef unsigned int size_t;
#endif
typedef unsigned int uintptr_t;
#endif /* __GNUC__ || _MSC_VER */
#define SDL_HAS_64BIT_TYPE 1
/* Enabled for SDL 1.2 (binary compatibility) */
#define HAVE_LIBC 1
#ifdef HAVE_LIBC
/* Useful headers */
#define HAVE_STDIO_H 1
#define STDC_HEADERS 1
#define HAVE_STRING_H 1
#define HAVE_CTYPE_H 1
#define HAVE_MATH_H 1
#ifndef _WIN32_WCE
#define HAVE_SIGNAL_H 1
#endif
/* C library functions */
#define HAVE_MALLOC 1
#define HAVE_CALLOC 1
#define HAVE_REALLOC 1
#define HAVE_FREE 1
#define HAVE_ALLOCA 1
#define HAVE_QSORT 1
#define HAVE_ABS 1
#define HAVE_MEMSET 1
#define HAVE_MEMCPY 1
#define HAVE_MEMMOVE 1
#define HAVE_MEMCMP 1
#define HAVE_STRLEN 1
#define HAVE__STRREV 1
#define HAVE__STRUPR 1
#define HAVE__STRLWR 1
#define HAVE_STRCHR 1
#define HAVE_STRRCHR 1
#define HAVE_STRSTR 1
#define HAVE_ITOA 1
#define HAVE__LTOA 1
#define HAVE__ULTOA 1
#define HAVE_STRTOL 1
#define HAVE_STRTOUL 1
#define HAVE_STRTOLL 1
#define HAVE_STRTOD 1
#define HAVE_ATOI 1
#define HAVE_ATOF 1
#define HAVE_STRCMP 1
#define HAVE_STRNCMP 1
#define HAVE__STRICMP 1
#define HAVE__STRNICMP 1
#define HAVE_SSCANF 1
#else
#define HAVE_STDARG_H 1
#define HAVE_STDDEF_H 1
#endif
/* Enable various audio drivers */
#ifndef _WIN32_WCE
#define SDL_AUDIO_DRIVER_DSOUND 1
#endif
#define SDL_AUDIO_DRIVER_WAVEOUT 1
#define SDL_AUDIO_DRIVER_DISK 1
#define SDL_AUDIO_DRIVER_DUMMY 1
/* Enable various cdrom drivers */
#ifdef _WIN32_WCE
#define SDL_CDROM_DISABLED 1
#else
#define SDL_CDROM_WIN32 1
#endif
/* Enable various input drivers */
#ifdef _WIN32_WCE
#define SDL_JOYSTICK_DISABLED 1
#else
#define SDL_JOYSTICK_WINMM 1
#endif
/* Enable various shared object loading systems */
#define SDL_LOADSO_WIN32 1
/* Enable various threading systems */
#define SDL_THREAD_WIN32 1
/* Enable various timer systems */
#ifdef _WIN32_WCE
#define SDL_TIMER_WINCE 1
#else
#define SDL_TIMER_WIN32 1
#endif
/* Enable various video drivers */
#ifdef _WIN32_WCE
#define SDL_VIDEO_DRIVER_GAPI 1
#endif
#ifndef _WIN32_WCE
#define SDL_VIDEO_DRIVER_DDRAW 1
#endif
#define SDL_VIDEO_DRIVER_DUMMY 1
#define SDL_VIDEO_DRIVER_WINDIB 1
/* Enable OpenGL support */
#ifndef _WIN32_WCE
#define SDL_VIDEO_OPENGL 1
#define SDL_VIDEO_OPENGL_WGL 1
#endif
/* Enable assembly routines (Win64 doesn't have inline asm) */
#ifndef _WIN64
#define SDL_ASSEMBLY_ROUTINES 1
#endif
#endif /* _SDL_config_win32_h */

View File

@ -1,22 +0,0 @@
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/

View File

@ -1,75 +0,0 @@
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* CPU feature detection for SDL */
#ifndef _SDL_cpuinfo_h
#define _SDL_cpuinfo_h
#include "SDL_stdinc.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
/* This function returns true if the CPU has the RDTSC instruction
*/
extern DECLSPEC SDL_bool SDLCALL SDL_HasRDTSC(void);
/* This function returns true if the CPU has MMX features
*/
extern DECLSPEC SDL_bool SDLCALL SDL_HasMMX(void);
/* This function returns true if the CPU has MMX Ext. features
*/
extern DECLSPEC SDL_bool SDLCALL SDL_HasMMXExt(void);
/* This function returns true if the CPU has 3DNow features
*/
extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNow(void);
/* This function returns true if the CPU has 3DNow! Ext. features
*/
extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNowExt(void);
/* This function returns true if the CPU has SSE features
*/
extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE(void);
/* This function returns true if the CPU has SSE2 features
*/
extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE2(void);
/* This function returns true if the CPU has AltiVec features
*/
extern DECLSPEC SDL_bool SDLCALL SDL_HasAltiVec(void);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif /* _SDL_cpuinfo_h */

View File

@ -1,192 +0,0 @@
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/* Functions for reading and writing endian-specific values */
#ifndef _SDL_endian_h
#define _SDL_endian_h
#include "SDL_stdinc.h"
/* The two types of endianness */
#define SDL_LIL_ENDIAN 1234
#define SDL_BIG_ENDIAN 4321
#ifndef SDL_BYTEORDER /* Not defined in SDL_config.h? */
#if defined(__hppa__) || \
defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \
(defined(__MIPS__) && defined(__MISPEB__)) || \
defined(__ppc__) || defined(__POWERPC__) || defined(_M_PPC) || \
defined(__sparc__)
#define SDL_BYTEORDER SDL_BIG_ENDIAN
#else
#define SDL_BYTEORDER SDL_LIL_ENDIAN
#endif
#endif /* !SDL_BYTEORDER */
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
/* Use inline functions for compilers that support them, and static
functions for those that do not. Because these functions become
static for compilers that do not support inline functions, this
header should only be included in files that actually use them.
*/
#if defined(__GNUC__) && defined(__i386__) && \
!(__GNUC__ == 2 && __GNUC_MINOR__ == 95 /* broken gcc version */)
static __inline__ Uint16 SDL_Swap16(Uint16 x)
{
__asm__("xchgb %b0,%h0" : "=q" (x) : "0" (x));
return x;
}
#elif defined(__GNUC__) && defined(__x86_64__)
static __inline__ Uint16 SDL_Swap16(Uint16 x)
{
__asm__("xchgb %b0,%h0" : "=Q" (x) : "0" (x));
return x;
}
#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__))
static __inline__ Uint16 SDL_Swap16(Uint16 x)
{
Uint16 result;
__asm__("rlwimi %0,%2,8,16,23" : "=&r" (result) : "0" (x >> 8), "r" (x));
return result;
}
#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__))
static __inline__ Uint16 SDL_Swap16(Uint16 x)
{
__asm__("rorw #8,%0" : "=d" (x) : "0" (x) : "cc");
return x;
}
#else
static __inline__ Uint16 SDL_Swap16(Uint16 x) {
return((x<<8)|(x>>8));
}
#endif
#if defined(__GNUC__) && defined(__i386__)
static __inline__ Uint32 SDL_Swap32(Uint32 x)
{
__asm__("bswap %0" : "=r" (x) : "0" (x));
return x;
}
#elif defined(__GNUC__) && defined(__x86_64__)
static __inline__ Uint32 SDL_Swap32(Uint32 x)
{
__asm__("bswapl %0" : "=r" (x) : "0" (x));
return x;
}
#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__))
static __inline__ Uint32 SDL_Swap32(Uint32 x)
{
Uint32 result;
__asm__("rlwimi %0,%2,24,16,23" : "=&r" (result) : "0" (x>>24), "r" (x));
__asm__("rlwimi %0,%2,8,8,15" : "=&r" (result) : "0" (result), "r" (x));
__asm__("rlwimi %0,%2,24,0,7" : "=&r" (result) : "0" (result), "r" (x));
return result;
}
#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__))
static __inline__ Uint32 SDL_Swap32(Uint32 x)
{
__asm__("rorw #8,%0\n\tswap %0\n\trorw #8,%0" : "=d" (x) : "0" (x) : "cc");
return x;
}
#else
static __inline__ Uint32 SDL_Swap32(Uint32 x) {
return((x<<24)|((x<<8)&0x00FF0000)|((x>>8)&0x0000FF00)|(x>>24));
}
#endif
#ifdef SDL_HAS_64BIT_TYPE
#if defined(__GNUC__) && defined(__i386__)
static __inline__ Uint64 SDL_Swap64(Uint64 x)
{
union {
struct { Uint32 a,b; } s;
Uint64 u;
} v;
v.u = x;
__asm__("bswapl %0 ; bswapl %1 ; xchgl %0,%1"
: "=r" (v.s.a), "=r" (v.s.b)
: "0" (v.s.a), "1" (v.s.b));
return v.u;
}
#elif defined(__GNUC__) && defined(__x86_64__)
static __inline__ Uint64 SDL_Swap64(Uint64 x)
{
__asm__("bswapq %0" : "=r" (x) : "0" (x));
return x;
}
#else
static __inline__ Uint64 SDL_Swap64(Uint64 x)
{
Uint32 hi, lo;
/* Separate into high and low 32-bit values and swap them */
lo = (Uint32)(x&0xFFFFFFFF);
x >>= 32;
hi = (Uint32)(x&0xFFFFFFFF);
x = SDL_Swap32(lo);
x <<= 32;
x |= SDL_Swap32(hi);
return(x);
}
#endif
#else
/* This is mainly to keep compilers from complaining in SDL code.
If there is no real 64-bit datatype, then compilers will complain about
the fake 64-bit datatype that SDL provides when it compiles user code.
*/
#define SDL_Swap64(X) (X)
#endif /* SDL_HAS_64BIT_TYPE */
/* Byteswap item from the specified endianness to the native endianness */
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
#define SDL_SwapLE16(X) (X)
#define SDL_SwapLE32(X) (X)
#define SDL_SwapLE64(X) (X)
#define SDL_SwapBE16(X) SDL_Swap16(X)
#define SDL_SwapBE32(X) SDL_Swap32(X)
#define SDL_SwapBE64(X) SDL_Swap64(X)
#else
#define SDL_SwapLE16(X) SDL_Swap16(X)
#define SDL_SwapLE32(X) SDL_Swap32(X)
#define SDL_SwapLE64(X) SDL_Swap64(X)
#define SDL_SwapBE16(X) (X)
#define SDL_SwapBE32(X) (X)
#define SDL_SwapBE64(X) (X)
#endif
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif /* _SDL_endian_h */

View File

@ -1,61 +0,0 @@
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/* Simple error message routines for SDL */
#ifndef _SDL_error_h
#define _SDL_error_h
#include "SDL_stdinc.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
/* Public functions */
extern DECLSPEC void SDLCALL SDL_SetError(const char *fmt, ...);
extern DECLSPEC char * SDLCALL SDL_GetError(void);
extern DECLSPEC void SDLCALL SDL_ClearError(void);
/* Private error message function - used internally */
#define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM)
#define SDL_Unsupported() SDL_Error(SDL_UNSUPPORTED)
typedef enum {
SDL_ENOMEM,
SDL_EFREAD,
SDL_EFWRITE,
SDL_EFSEEK,
SDL_UNSUPPORTED,
SDL_LASTERROR
} SDL_errorcode;
extern DECLSPEC void SDLCALL SDL_Error(SDL_errorcode code);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif /* _SDL_error_h */

View File

@ -1,337 +0,0 @@
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/* Include file for SDL event handling */
#ifndef _SDL_events_h
#define _SDL_events_h
#include "SDL_stdinc.h"
#include "SDL_error.h"
#include "SDL_active.h"
#include "SDL_keyboard.h"
#include "SDL_mouse.h"
#include "SDL_joystick.h"
#include "SDL_quit.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
/* General keyboard/mouse state definitions */
#define SDL_RELEASED 0
#define SDL_PRESSED 1
/* Event enumerations */
typedef enum {
SDL_NOEVENT = 0, /* Unused (do not remove) */
SDL_ACTIVEEVENT, /* Application loses/gains visibility */
SDL_KEYDOWN, /* Keys pressed */
SDL_KEYUP, /* Keys released */
SDL_MOUSEMOTION, /* Mouse moved */
SDL_MOUSEBUTTONDOWN, /* Mouse button pressed */
SDL_MOUSEBUTTONUP, /* Mouse button released */
SDL_JOYAXISMOTION, /* Joystick axis motion */
SDL_JOYBALLMOTION, /* Joystick trackball motion */
SDL_JOYHATMOTION, /* Joystick hat position change */
SDL_JOYBUTTONDOWN, /* Joystick button pressed */
SDL_JOYBUTTONUP, /* Joystick button released */
SDL_QUIT, /* User-requested quit */
SDL_SYSWMEVENT, /* System specific event */
SDL_EVENT_RESERVEDA, /* Reserved for future use.. */
SDL_EVENT_RESERVEDB, /* Reserved for future use.. */
SDL_VIDEORESIZE, /* User resized video mode */
SDL_VIDEOEXPOSE, /* Screen needs to be redrawn */
SDL_EVENT_RESERVED2, /* Reserved for future use.. */
SDL_EVENT_RESERVED3, /* Reserved for future use.. */
SDL_EVENT_RESERVED4, /* Reserved for future use.. */
SDL_EVENT_RESERVED5, /* Reserved for future use.. */
SDL_EVENT_RESERVED6, /* Reserved for future use.. */
SDL_EVENT_RESERVED7, /* Reserved for future use.. */
/* Events SDL_USEREVENT through SDL_MAXEVENTS-1 are for your use */
SDL_USEREVENT = 24,
/* This last event is only for bounding internal arrays
It is the number of bits in the event mask datatype -- Uint32
*/
SDL_NUMEVENTS = 32
} SDL_EventType;
/* Predefined event masks */
#define SDL_EVENTMASK(X) (1<<(X))
typedef enum {
SDL_ACTIVEEVENTMASK = SDL_EVENTMASK(SDL_ACTIVEEVENT),
SDL_KEYDOWNMASK = SDL_EVENTMASK(SDL_KEYDOWN),
SDL_KEYUPMASK = SDL_EVENTMASK(SDL_KEYUP),
SDL_KEYEVENTMASK = SDL_EVENTMASK(SDL_KEYDOWN)|
SDL_EVENTMASK(SDL_KEYUP),
SDL_MOUSEMOTIONMASK = SDL_EVENTMASK(SDL_MOUSEMOTION),
SDL_MOUSEBUTTONDOWNMASK = SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN),
SDL_MOUSEBUTTONUPMASK = SDL_EVENTMASK(SDL_MOUSEBUTTONUP),
SDL_MOUSEEVENTMASK = SDL_EVENTMASK(SDL_MOUSEMOTION)|
SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN)|
SDL_EVENTMASK(SDL_MOUSEBUTTONUP),
SDL_JOYAXISMOTIONMASK = SDL_EVENTMASK(SDL_JOYAXISMOTION),
SDL_JOYBALLMOTIONMASK = SDL_EVENTMASK(SDL_JOYBALLMOTION),
SDL_JOYHATMOTIONMASK = SDL_EVENTMASK(SDL_JOYHATMOTION),
SDL_JOYBUTTONDOWNMASK = SDL_EVENTMASK(SDL_JOYBUTTONDOWN),
SDL_JOYBUTTONUPMASK = SDL_EVENTMASK(SDL_JOYBUTTONUP),
SDL_JOYEVENTMASK = SDL_EVENTMASK(SDL_JOYAXISMOTION)|
SDL_EVENTMASK(SDL_JOYBALLMOTION)|
SDL_EVENTMASK(SDL_JOYHATMOTION)|
SDL_EVENTMASK(SDL_JOYBUTTONDOWN)|
SDL_EVENTMASK(SDL_JOYBUTTONUP),
SDL_VIDEORESIZEMASK = SDL_EVENTMASK(SDL_VIDEORESIZE),
SDL_VIDEOEXPOSEMASK = SDL_EVENTMASK(SDL_VIDEOEXPOSE),
SDL_QUITMASK = SDL_EVENTMASK(SDL_QUIT),
SDL_SYSWMEVENTMASK = SDL_EVENTMASK(SDL_SYSWMEVENT)
} SDL_EventMask ;
#define SDL_ALLEVENTS 0xFFFFFFFF
/* Application visibility event structure */
typedef struct SDL_ActiveEvent {
Uint8 type; /* SDL_ACTIVEEVENT */
Uint8 gain; /* Whether given states were gained or lost (1/0) */
Uint8 state; /* A mask of the focus states */
} SDL_ActiveEvent;
/* Keyboard event structure */
typedef struct SDL_KeyboardEvent {
Uint8 type; /* SDL_KEYDOWN or SDL_KEYUP */
Uint8 which; /* The keyboard device index */
Uint8 state; /* SDL_PRESSED or SDL_RELEASED */
SDL_keysym keysym;
} SDL_KeyboardEvent;
/* Mouse motion event structure */
typedef struct SDL_MouseMotionEvent {
Uint8 type; /* SDL_MOUSEMOTION */
Uint8 which; /* The mouse device index */
Uint8 state; /* The current button state */
Uint16 x, y; /* The X/Y coordinates of the mouse */
Sint16 xrel; /* The relative motion in the X direction */
Sint16 yrel; /* The relative motion in the Y direction */
} SDL_MouseMotionEvent;
/* Mouse button event structure */
typedef struct SDL_MouseButtonEvent {
Uint8 type; /* SDL_MOUSEBUTTONDOWN or SDL_MOUSEBUTTONUP */
Uint8 which; /* The mouse device index */
Uint8 button; /* The mouse button index */
Uint8 state; /* SDL_PRESSED or SDL_RELEASED */
Uint16 x, y; /* The X/Y coordinates of the mouse at press time */
} SDL_MouseButtonEvent;
/* Joystick axis motion event structure */
typedef struct SDL_JoyAxisEvent {
Uint8 type; /* SDL_JOYAXISMOTION */
Uint8 which; /* The joystick device index */
Uint8 axis; /* The joystick axis index */
Sint16 value; /* The axis value (range: -32768 to 32767) */
} SDL_JoyAxisEvent;
/* Joystick trackball motion event structure */
typedef struct SDL_JoyBallEvent {
Uint8 type; /* SDL_JOYBALLMOTION */
Uint8 which; /* The joystick device index */
Uint8 ball; /* The joystick trackball index */
Sint16 xrel; /* The relative motion in the X direction */
Sint16 yrel; /* The relative motion in the Y direction */
} SDL_JoyBallEvent;
/* Joystick hat position change event structure */
typedef struct SDL_JoyHatEvent {
Uint8 type; /* SDL_JOYHATMOTION */
Uint8 which; /* The joystick device index */
Uint8 hat; /* The joystick hat index */
Uint8 value; /* The hat position value:
SDL_HAT_LEFTUP SDL_HAT_UP SDL_HAT_RIGHTUP
SDL_HAT_LEFT SDL_HAT_CENTERED SDL_HAT_RIGHT
SDL_HAT_LEFTDOWN SDL_HAT_DOWN SDL_HAT_RIGHTDOWN
Note that zero means the POV is centered.
*/
} SDL_JoyHatEvent;
/* Joystick button event structure */
typedef struct SDL_JoyButtonEvent {
Uint8 type; /* SDL_JOYBUTTONDOWN or SDL_JOYBUTTONUP */
Uint8 which; /* The joystick device index */
Uint8 button; /* The joystick button index */
Uint8 state; /* SDL_PRESSED or SDL_RELEASED */
} SDL_JoyButtonEvent;
/* The "window resized" event
When you get this event, you are responsible for setting a new video
mode with the new width and height.
*/
typedef struct SDL_ResizeEvent {
Uint8 type; /* SDL_VIDEORESIZE */
int w; /* New width */
int h; /* New height */
} SDL_ResizeEvent;
/* The "screen redraw" event */
typedef struct SDL_ExposeEvent {
Uint8 type; /* SDL_VIDEOEXPOSE */
} SDL_ExposeEvent;
/* The "quit requested" event */
typedef struct SDL_QuitEvent {
Uint8 type; /* SDL_QUIT */
} SDL_QuitEvent;
/* A user-defined event type */
typedef struct SDL_UserEvent {
Uint8 type; /* SDL_USEREVENT through SDL_NUMEVENTS-1 */
int code; /* User defined event code */
void *data1; /* User defined data pointer */
void *data2; /* User defined data pointer */
} SDL_UserEvent;
/* If you want to use this event, you should include SDL_syswm.h */
struct SDL_SysWMmsg;
typedef struct SDL_SysWMmsg SDL_SysWMmsg;
typedef struct SDL_SysWMEvent {
Uint8 type;
SDL_SysWMmsg *msg;
} SDL_SysWMEvent;
/* General event structure */
typedef union SDL_Event {
Uint8 type;
SDL_ActiveEvent active;
SDL_KeyboardEvent key;
SDL_MouseMotionEvent motion;
SDL_MouseButtonEvent button;
SDL_JoyAxisEvent jaxis;
SDL_JoyBallEvent jball;
SDL_JoyHatEvent jhat;
SDL_JoyButtonEvent jbutton;
SDL_ResizeEvent resize;
SDL_ExposeEvent expose;
SDL_QuitEvent quit;
SDL_UserEvent user;
SDL_SysWMEvent syswm;
} SDL_Event;
/* Function prototypes */
/* Pumps the event loop, gathering events from the input devices.
This function updates the event queue and internal input device state.
This should only be run in the thread that sets the video mode.
*/
extern DECLSPEC void SDLCALL SDL_PumpEvents(void);
/* Checks the event queue for messages and optionally returns them.
If 'action' is SDL_ADDEVENT, up to 'numevents' events will be added to
the back of the event queue.
If 'action' is SDL_PEEKEVENT, up to 'numevents' events at the front
of the event queue, matching 'mask', will be returned and will not
be removed from the queue.
If 'action' is SDL_GETEVENT, up to 'numevents' events at the front
of the event queue, matching 'mask', will be returned and will be
removed from the queue.
This function returns the number of events actually stored, or -1
if there was an error. This function is thread-safe.
*/
typedef enum {
SDL_ADDEVENT,
SDL_PEEKEVENT,
SDL_GETEVENT
} SDL_eventaction;
/* */
extern DECLSPEC int SDLCALL SDL_PeepEvents(SDL_Event *events, int numevents,
SDL_eventaction action, Uint32 mask);
/* Polls for currently pending events, and returns 1 if there are any pending
events, or 0 if there are none available. If 'event' is not NULL, the next
event is removed from the queue and stored in that area.
*/
extern DECLSPEC int SDLCALL SDL_PollEvent(SDL_Event *event);
/* Waits indefinitely for the next available event, returning 1, or 0 if there
was an error while waiting for events. If 'event' is not NULL, the next
event is removed from the queue and stored in that area.
*/
extern DECLSPEC int SDLCALL SDL_WaitEvent(SDL_Event *event);
/* Add an event to the event queue.
This function returns 0 on success, or -1 if the event queue was full
or there was some other error.
*/
extern DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event *event);
/*
This function sets up a filter to process all events before they
change internal state and are posted to the internal event queue.
The filter is protypted as:
*/
typedef int (SDLCALL *SDL_EventFilter)(const SDL_Event *event);
/*
If the filter returns 1, then the event will be added to the internal queue.
If it returns 0, then the event will be dropped from the queue, but the
internal state will still be updated. This allows selective filtering of
dynamically arriving events.
WARNING: Be very careful of what you do in the event filter function, as
it may run in a different thread!
There is one caveat when dealing with the SDL_QUITEVENT event type. The
event filter is only called when the window manager desires to close the
application window. If the event filter returns 1, then the window will
be closed, otherwise the window will remain open if possible.
If the quit event is generated by an interrupt signal, it will bypass the
internal queue and be delivered to the application at the next event poll.
*/
extern DECLSPEC void SDLCALL SDL_SetEventFilter(SDL_EventFilter filter);
/*
Return the current event filter - can be used to "chain" filters.
If there is no event filter set, this function returns NULL.
*/
extern DECLSPEC SDL_EventFilter SDLCALL SDL_GetEventFilter(void);
/*
This function allows you to set the state of processing certain events.
If 'state' is set to SDL_IGNORE, that event will be automatically dropped
from the event queue and will not event be filtered.
If 'state' is set to SDL_ENABLE, that event will be processed normally.
If 'state' is set to SDL_QUERY, SDL_EventState() will return the
current processing state of the specified event.
*/
#define SDL_QUERY -1
#define SDL_IGNORE 0
#define SDL_DISABLE 0
#define SDL_ENABLE 1
extern DECLSPEC Uint8 SDLCALL SDL_EventState(Uint8 type, int state);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif /* _SDL_events_h */

View File

@ -1,24 +0,0 @@
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/* DEPRECATED */
#include "SDL_stdinc.h"

View File

@ -1,167 +0,0 @@
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/* Include file for SDL joystick event handling */
#ifndef _SDL_joystick_h
#define _SDL_joystick_h
#include "SDL_stdinc.h"
#include "SDL_error.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
/* In order to use these functions, SDL_Init() must have been called
with the SDL_INIT_JOYSTICK flag. This causes SDL to scan the system
for joysticks, and load appropriate drivers.
*/
/* The joystick structure used to identify an SDL joystick */
struct _SDL_Joystick;
typedef struct _SDL_Joystick SDL_Joystick;
/* Function prototypes */
/*
* Count the number of joysticks attached to the system
*/
extern DECLSPEC int SDLCALL SDL_NumJoysticks(void);
/*
* Get the implementation dependent name of a joystick.
* This can be called before any joysticks are opened.
* If no name can be found, this function returns NULL.
*/
extern DECLSPEC const char * SDLCALL SDL_JoystickName(int device_index);
/*
* Open a joystick for use - the index passed as an argument refers to
* the N'th joystick on the system. This index is the value which will
* identify this joystick in future joystick events.
*
* This function returns a joystick identifier, or NULL if an error occurred.
*/
extern DECLSPEC SDL_Joystick * SDLCALL SDL_JoystickOpen(int device_index);
/*
* Returns 1 if the joystick has been opened, or 0 if it has not.
*/
extern DECLSPEC int SDLCALL SDL_JoystickOpened(int device_index);
/*
* Get the device index of an opened joystick.
*/
extern DECLSPEC int SDLCALL SDL_JoystickIndex(SDL_Joystick *joystick);
/*
* Get the number of general axis controls on a joystick
*/
extern DECLSPEC int SDLCALL SDL_JoystickNumAxes(SDL_Joystick *joystick);
/*
* Get the number of trackballs on a joystick
* Joystick trackballs have only relative motion events associated
* with them and their state cannot be polled.
*/
extern DECLSPEC int SDLCALL SDL_JoystickNumBalls(SDL_Joystick *joystick);
/*
* Get the number of POV hats on a joystick
*/
extern DECLSPEC int SDLCALL SDL_JoystickNumHats(SDL_Joystick *joystick);
/*
* Get the number of buttons on a joystick
*/
extern DECLSPEC int SDLCALL SDL_JoystickNumButtons(SDL_Joystick *joystick);
/*
* Update the current state of the open joysticks.
* This is called automatically by the event loop if any joystick
* events are enabled.
*/
extern DECLSPEC void SDLCALL SDL_JoystickUpdate(void);
/*
* Enable/disable joystick event polling.
* If joystick events are disabled, you must call SDL_JoystickUpdate()
* yourself and check the state of the joystick when you want joystick
* information.
* The state can be one of SDL_QUERY, SDL_ENABLE or SDL_IGNORE.
*/
extern DECLSPEC int SDLCALL SDL_JoystickEventState(int state);
/*
* Get the current state of an axis control on a joystick
* The state is a value ranging from -32768 to 32767.
* The axis indices start at index 0.
*/
extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick *joystick, int axis);
/*
* Get the current state of a POV hat on a joystick
* The return value is one of the following positions:
*/
#define SDL_HAT_CENTERED 0x00
#define SDL_HAT_UP 0x01
#define SDL_HAT_RIGHT 0x02
#define SDL_HAT_DOWN 0x04
#define SDL_HAT_LEFT 0x08
#define SDL_HAT_RIGHTUP (SDL_HAT_RIGHT|SDL_HAT_UP)
#define SDL_HAT_RIGHTDOWN (SDL_HAT_RIGHT|SDL_HAT_DOWN)
#define SDL_HAT_LEFTUP (SDL_HAT_LEFT|SDL_HAT_UP)
#define SDL_HAT_LEFTDOWN (SDL_HAT_LEFT|SDL_HAT_DOWN)
/*
* The hat indices start at index 0.
*/
extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetHat(SDL_Joystick *joystick, int hat);
/*
* Get the ball axis change since the last poll
* This returns 0, or -1 if you passed it invalid parameters.
* The ball indices start at index 0.
*/
extern DECLSPEC int SDLCALL SDL_JoystickGetBall(SDL_Joystick *joystick, int ball, int *dx, int *dy);
/*
* Get the current state of a button on a joystick
* The button indices start at index 0.
*/
extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetButton(SDL_Joystick *joystick, int button);
/*
* Close a joystick previously opened with SDL_JoystickOpen()
*/
extern DECLSPEC void SDLCALL SDL_JoystickClose(SDL_Joystick *joystick);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif /* _SDL_joystick_h */

View File

@ -1,121 +0,0 @@
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/* Include file for SDL keyboard event handling */
#ifndef _SDL_keyboard_h
#define _SDL_keyboard_h
#include "SDL_stdinc.h"
#include "SDL_error.h"
#include "SDL_keysym.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
/* Keysym structure
- The scancode is hardware dependent, and should not be used by general
applications. If no hardware scancode is available, it will be 0.
- The 'unicode' translated character is only available when character
translation is enabled by the SDL_EnableUNICODE() API. If non-zero,
this is a UNICODE character corresponding to the keypress. If the
high 9 bits of the character are 0, then this maps to the equivalent
ASCII character:
char ch;
if ( (keysym.unicode & 0xFF80) == 0 ) {
ch = keysym.unicode & 0x7F;
} else {
An international character..
}
*/
typedef struct SDL_keysym {
Uint8 scancode; /* hardware specific scancode */
SDLKey sym; /* SDL virtual keysym */
SDLMod mod; /* current key modifiers */
Uint16 unicode; /* translated character */
} SDL_keysym;
/* This is the mask which refers to all hotkey bindings */
#define SDL_ALL_HOTKEYS 0xFFFFFFFF
/* Function prototypes */
/*
* Enable/Disable UNICODE translation of keyboard input.
* This translation has some overhead, so translation defaults off.
* If 'enable' is 1, translation is enabled.
* If 'enable' is 0, translation is disabled.
* If 'enable' is -1, the translation state is not changed.
* It returns the previous state of keyboard translation.
*/
extern DECLSPEC int SDLCALL SDL_EnableUNICODE(int enable);
/*
* Enable/Disable keyboard repeat. Keyboard repeat defaults to off.
* 'delay' is the initial delay in ms between the time when a key is
* pressed, and keyboard repeat begins.
* 'interval' is the time in ms between keyboard repeat events.
*/
#define SDL_DEFAULT_REPEAT_DELAY 500
#define SDL_DEFAULT_REPEAT_INTERVAL 30
/*
* If 'delay' is set to 0, keyboard repeat is disabled.
*/
extern DECLSPEC int SDLCALL SDL_EnableKeyRepeat(int delay, int interval);
extern DECLSPEC void SDLCALL SDL_GetKeyRepeat(int *delay, int *interval);
/*
* Get a snapshot of the current state of the keyboard.
* Returns an array of keystates, indexed by the SDLK_* syms.
* Used:
* Uint8 *keystate = SDL_GetKeyState(NULL);
* if ( keystate[SDLK_RETURN] ) ... <RETURN> is pressed.
*/
extern DECLSPEC Uint8 * SDLCALL SDL_GetKeyState(int *numkeys);
/*
* Get the current key modifier state
*/
extern DECLSPEC SDLMod SDLCALL SDL_GetModState(void);
/*
* Set the current key modifier state
* This does not change the keyboard state, only the key modifier flags.
*/
extern DECLSPEC void SDLCALL SDL_SetModState(SDLMod modstate);
/*
* Get the name of an SDL virtual keysym
*/
extern DECLSPEC char * SDLCALL SDL_GetKeyName(SDLKey key);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif /* _SDL_keyboard_h */

View File

@ -1,311 +0,0 @@
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#ifndef _SDL_keysym_h
#define _SDL_keysym_h
/* What we really want is a mapping of every raw key on the keyboard.
To support international keyboards, we use the range 0xA1 - 0xFF
as international virtual keycodes. We'll follow in the footsteps of X11...
The names of the keys
*/
typedef enum {
/* The keyboard syms have been cleverly chosen to map to ASCII */
SDLK_UNKNOWN = 0,
SDLK_FIRST = 0,
SDLK_BACKSPACE = 8,
SDLK_TAB = 9,
SDLK_CLEAR = 12,
SDLK_RETURN = 13,
SDLK_PAUSE = 19,
SDLK_ESCAPE = 27,
SDLK_SPACE = 32,
SDLK_EXCLAIM = 33,
SDLK_QUOTEDBL = 34,
SDLK_HASH = 35,
SDLK_DOLLAR = 36,
SDLK_AMPERSAND = 38,
SDLK_QUOTE = 39,
SDLK_LEFTPAREN = 40,
SDLK_RIGHTPAREN = 41,
SDLK_ASTERISK = 42,
SDLK_PLUS = 43,
SDLK_COMMA = 44,
SDLK_MINUS = 45,
SDLK_PERIOD = 46,
SDLK_SLASH = 47,
SDLK_0 = 48,
SDLK_1 = 49,
SDLK_2 = 50,
SDLK_3 = 51,
SDLK_4 = 52,
SDLK_5 = 53,
SDLK_6 = 54,
SDLK_7 = 55,
SDLK_8 = 56,
SDLK_9 = 57,
SDLK_COLON = 58,
SDLK_SEMICOLON = 59,
SDLK_LESS = 60,
SDLK_EQUALS = 61,
SDLK_GREATER = 62,
SDLK_QUESTION = 63,
SDLK_AT = 64,
/*
Skip uppercase letters
*/
SDLK_LEFTBRACKET = 91,
SDLK_BACKSLASH = 92,
SDLK_RIGHTBRACKET = 93,
SDLK_CARET = 94,
SDLK_UNDERSCORE = 95,
SDLK_BACKQUOTE = 96,
SDLK_a = 97,
SDLK_b = 98,
SDLK_c = 99,
SDLK_d = 100,
SDLK_e = 101,
SDLK_f = 102,
SDLK_g = 103,
SDLK_h = 104,
SDLK_i = 105,
SDLK_j = 106,
SDLK_k = 107,
SDLK_l = 108,
SDLK_m = 109,
SDLK_n = 110,
SDLK_o = 111,
SDLK_p = 112,
SDLK_q = 113,
SDLK_r = 114,
SDLK_s = 115,
SDLK_t = 116,
SDLK_u = 117,
SDLK_v = 118,
SDLK_w = 119,
SDLK_x = 120,
SDLK_y = 121,
SDLK_z = 122,
SDLK_DELETE = 127,
/* End of ASCII mapped keysyms */
/* International keyboard syms */
SDLK_WORLD_0 = 160, /* 0xA0 */
SDLK_WORLD_1 = 161,
SDLK_WORLD_2 = 162,
SDLK_WORLD_3 = 163,
SDLK_WORLD_4 = 164,
SDLK_WORLD_5 = 165,
SDLK_WORLD_6 = 166,
SDLK_WORLD_7 = 167,
SDLK_WORLD_8 = 168,
SDLK_WORLD_9 = 169,
SDLK_WORLD_10 = 170,
SDLK_WORLD_11 = 171,
SDLK_WORLD_12 = 172,
SDLK_WORLD_13 = 173,
SDLK_WORLD_14 = 174,
SDLK_WORLD_15 = 175,
SDLK_WORLD_16 = 176,
SDLK_WORLD_17 = 177,
SDLK_WORLD_18 = 178,
SDLK_WORLD_19 = 179,
SDLK_WORLD_20 = 180,
SDLK_WORLD_21 = 181,
SDLK_WORLD_22 = 182,
SDLK_WORLD_23 = 183,
SDLK_WORLD_24 = 184,
SDLK_WORLD_25 = 185,
SDLK_WORLD_26 = 186,
SDLK_WORLD_27 = 187,
SDLK_WORLD_28 = 188,
SDLK_WORLD_29 = 189,
SDLK_WORLD_30 = 190,
SDLK_WORLD_31 = 191,
SDLK_WORLD_32 = 192,
SDLK_WORLD_33 = 193,
SDLK_WORLD_34 = 194,
SDLK_WORLD_35 = 195,
SDLK_WORLD_36 = 196,
SDLK_WORLD_37 = 197,
SDLK_WORLD_38 = 198,
SDLK_WORLD_39 = 199,
SDLK_WORLD_40 = 200,
SDLK_WORLD_41 = 201,
SDLK_WORLD_42 = 202,
SDLK_WORLD_43 = 203,
SDLK_WORLD_44 = 204,
SDLK_WORLD_45 = 205,
SDLK_WORLD_46 = 206,
SDLK_WORLD_47 = 207,
SDLK_WORLD_48 = 208,
SDLK_WORLD_49 = 209,
SDLK_WORLD_50 = 210,
SDLK_WORLD_51 = 211,
SDLK_WORLD_52 = 212,
SDLK_WORLD_53 = 213,
SDLK_WORLD_54 = 214,
SDLK_WORLD_55 = 215,
SDLK_WORLD_56 = 216,
SDLK_WORLD_57 = 217,
SDLK_WORLD_58 = 218,
SDLK_WORLD_59 = 219,
SDLK_WORLD_60 = 220,
SDLK_WORLD_61 = 221,
SDLK_WORLD_62 = 222,
SDLK_WORLD_63 = 223,
SDLK_WORLD_64 = 224,
SDLK_WORLD_65 = 225,
SDLK_WORLD_66 = 226,
SDLK_WORLD_67 = 227,
SDLK_WORLD_68 = 228,
SDLK_WORLD_69 = 229,
SDLK_WORLD_70 = 230,
SDLK_WORLD_71 = 231,
SDLK_WORLD_72 = 232,
SDLK_WORLD_73 = 233,
SDLK_WORLD_74 = 234,
SDLK_WORLD_75 = 235,
SDLK_WORLD_76 = 236,
SDLK_WORLD_77 = 237,
SDLK_WORLD_78 = 238,
SDLK_WORLD_79 = 239,
SDLK_WORLD_80 = 240,
SDLK_WORLD_81 = 241,
SDLK_WORLD_82 = 242,
SDLK_WORLD_83 = 243,
SDLK_WORLD_84 = 244,
SDLK_WORLD_85 = 245,
SDLK_WORLD_86 = 246,
SDLK_WORLD_87 = 247,
SDLK_WORLD_88 = 248,
SDLK_WORLD_89 = 249,
SDLK_WORLD_90 = 250,
SDLK_WORLD_91 = 251,
SDLK_WORLD_92 = 252,
SDLK_WORLD_93 = 253,
SDLK_WORLD_94 = 254,
SDLK_WORLD_95 = 255, /* 0xFF */
/* Numeric keypad */
SDLK_KP0 = 256,
SDLK_KP1 = 257,
SDLK_KP2 = 258,
SDLK_KP3 = 259,
SDLK_KP4 = 260,
SDLK_KP5 = 261,
SDLK_KP6 = 262,
SDLK_KP7 = 263,
SDLK_KP8 = 264,
SDLK_KP9 = 265,
SDLK_KP_PERIOD = 266,
SDLK_KP_DIVIDE = 267,
SDLK_KP_MULTIPLY = 268,
SDLK_KP_MINUS = 269,
SDLK_KP_PLUS = 270,
SDLK_KP_ENTER = 271,
SDLK_KP_EQUALS = 272,
/* Arrows + Home/End pad */
SDLK_UP = 273,
SDLK_DOWN = 274,
SDLK_RIGHT = 275,
SDLK_LEFT = 276,
SDLK_INSERT = 277,
SDLK_HOME = 278,
SDLK_END = 279,
SDLK_PAGEUP = 280,
SDLK_PAGEDOWN = 281,
/* Function keys */
SDLK_F1 = 282,
SDLK_F2 = 283,
SDLK_F3 = 284,
SDLK_F4 = 285,
SDLK_F5 = 286,
SDLK_F6 = 287,
SDLK_F7 = 288,
SDLK_F8 = 289,
SDLK_F9 = 290,
SDLK_F10 = 291,
SDLK_F11 = 292,
SDLK_F12 = 293,
SDLK_F13 = 294,
SDLK_F14 = 295,
SDLK_F15 = 296,
/* Key state modifier keys */
SDLK_NUMLOCK = 300,
SDLK_CAPSLOCK = 301,
SDLK_SCROLLOCK = 302,
SDLK_RSHIFT = 303,
SDLK_LSHIFT = 304,
SDLK_RCTRL = 305,
SDLK_LCTRL = 306,
SDLK_RALT = 307,
SDLK_LALT = 308,
SDLK_RMETA = 309,
SDLK_LMETA = 310,
SDLK_LSUPER = 311, /* Left "Windows" key */
SDLK_RSUPER = 312, /* Right "Windows" key */
SDLK_MODE = 313, /* "Alt Gr" key */
SDLK_COMPOSE = 314, /* Multi-key compose key */
/* Miscellaneous function keys */
SDLK_HELP = 315,
SDLK_PRINT = 316,
SDLK_SYSREQ = 317,
SDLK_BREAK = 318,
SDLK_MENU = 319,
SDLK_POWER = 320, /* Power Macintosh power key */
SDLK_EURO = 321, /* Some european keyboards */
SDLK_UNDO = 322, /* Atari keyboard has Undo */
/* Add any other keys here */
SDLK_LAST
} SDLKey;
/* Enumeration of valid key mods (possibly OR'd together) */
typedef enum {
KMOD_NONE = 0x0000,
KMOD_LSHIFT= 0x0001,
KMOD_RSHIFT= 0x0002,
KMOD_LCTRL = 0x0040,
KMOD_RCTRL = 0x0080,
KMOD_LALT = 0x0100,
KMOD_RALT = 0x0200,
KMOD_LMETA = 0x0400,
KMOD_RMETA = 0x0800,
KMOD_NUM = 0x1000,
KMOD_CAPS = 0x2000,
KMOD_MODE = 0x4000,
KMOD_RESERVED = 0x8000
} SDLMod;
#define KMOD_CTRL (KMOD_LCTRL|KMOD_RCTRL)
#define KMOD_SHIFT (KMOD_LSHIFT|KMOD_RSHIFT)
#define KMOD_ALT (KMOD_LALT|KMOD_RALT)
#define KMOD_META (KMOD_LMETA|KMOD_RMETA)
#endif /* _SDL_keysym_h */

View File

@ -1,74 +0,0 @@
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* System dependent library loading routines */
/* Some things to keep in mind:
- These functions only work on C function names. Other languages may
have name mangling and intrinsic language support that varies from
compiler to compiler.
- Make sure you declare your function pointers with the same calling
convention as the actual library function. Your code will crash
mysteriously if you do not do this.
- Avoid namespace collisions. If you load a symbol from the library,
it is not defined whether or not it goes into the global symbol
namespace for the application. If it does and it conflicts with
symbols in your code or other shared libraries, you will not get
the results you expect. :)
*/
#ifndef _SDL_loadso_h
#define _SDL_loadso_h
#include "SDL_stdinc.h"
#include "SDL_error.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
/* This function dynamically loads a shared object and returns a pointer
* to the object handle (or NULL if there was an error).
* The 'sofile' parameter is a system dependent name of the object file.
*/
extern DECLSPEC void * SDLCALL SDL_LoadObject(const char *sofile);
/* Given an object handle, this function looks up the address of the
* named function in the shared object and returns it. This address
* is no longer valid after calling SDL_UnloadObject().
*/
extern DECLSPEC void * SDLCALL SDL_LoadFunction(void *handle, const char *name);
/* Unload a shared object from memory */
extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif /* _SDL_loadso_h */

View File

@ -1,98 +0,0 @@
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#ifndef _SDL_main_h
#define _SDL_main_h
#include "SDL_stdinc.h"
/* Redefine main() on Win32 and MacOS so that it is called by winmain.c */
#if defined(__WIN32__) || \
(defined(__MWERKS__) && !defined(__BEOS__)) || \
defined(__MACOS__) || defined(__MACOSX__) || \
defined(__SYMBIAN32__) || defined(QWS)
#ifdef __cplusplus
#define C_LINKAGE "C"
#else
#define C_LINKAGE
#endif /* __cplusplus */
/* The application's main() function must be called with C linkage,
and should be declared like this:
#ifdef __cplusplus
extern "C"
#endif
int main(int argc, char *argv[])
{
}
*/
#define main SDL_main
/* The prototype for the application's main() function */
extern C_LINKAGE int SDL_main(int argc, char *argv[]);
/* From the SDL library code -- needed for registering the app on Win32 */
#ifdef __WIN32__
#include "begin_code.h"
#ifdef __cplusplus
extern "C" {
#endif
/* This should be called from your WinMain() function, if any */
extern DECLSPEC void SDLCALL SDL_SetModuleHandle(void *hInst);
/* This can also be called, but is no longer necessary */
extern DECLSPEC int SDLCALL SDL_RegisterApp(char *name, Uint32 style, void *hInst);
/* This can also be called, but is no longer necessary (SDL_Quit calls it) */
extern DECLSPEC void SDLCALL SDL_UnregisterApp(void);
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif
/* From the SDL library code -- needed for registering QuickDraw on MacOS */
#if defined(__MACOS__)
#include "begin_code.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Forward declaration so we don't need to include QuickDraw.h */
struct QDGlobals;
/* This should be called from your main() function, if any */
extern DECLSPEC void SDLCALL SDL_InitQuickDraw(struct QDGlobals *the_qd);
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif
#endif /* Need to redefine main()? */
#endif /* _SDL_main_h */

View File

@ -1,136 +0,0 @@
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/* Include file for SDL mouse event handling */
#ifndef _SDL_mouse_h
#define _SDL_mouse_h
#include "SDL_stdinc.h"
#include "SDL_error.h"
#include "SDL_video.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
typedef struct WMcursor WMcursor; /* Implementation dependent */
typedef struct SDL_Cursor {
SDL_Rect area; /* The area of the mouse cursor */
Sint16 hot_x, hot_y; /* The "tip" of the cursor */
Uint8 *data; /* B/W cursor data */
Uint8 *mask; /* B/W cursor mask */
Uint8 *save[2]; /* Place to save cursor area */
WMcursor *wm_cursor; /* Window-manager cursor */
} SDL_Cursor;
/* Function prototypes */
/*
* Retrieve the current state of the mouse.
* The current button state is returned as a button bitmask, which can
* be tested using the SDL_BUTTON(X) macros, and x and y are set to the
* current mouse cursor position. You can pass NULL for either x or y.
*/
extern DECLSPEC Uint8 SDLCALL SDL_GetMouseState(int *x, int *y);
/*
* Retrieve the current state of the mouse.
* The current button state is returned as a button bitmask, which can
* be tested using the SDL_BUTTON(X) macros, and x and y are set to the
* mouse deltas since the last call to SDL_GetRelativeMouseState().
*/
extern DECLSPEC Uint8 SDLCALL SDL_GetRelativeMouseState(int *x, int *y);
/*
* Set the position of the mouse cursor (generates a mouse motion event)
*/
extern DECLSPEC void SDLCALL SDL_WarpMouse(Uint16 x, Uint16 y);
/*
* Create a cursor using the specified data and mask (in MSB format).
* The cursor width must be a multiple of 8 bits.
*
* The cursor is created in black and white according to the following:
* data mask resulting pixel on screen
* 0 1 White
* 1 1 Black
* 0 0 Transparent
* 1 0 Inverted color if possible, black if not.
*
* Cursors created with this function must be freed with SDL_FreeCursor().
*/
extern DECLSPEC SDL_Cursor * SDLCALL SDL_CreateCursor
(Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y);
/*
* Set the currently active cursor to the specified one.
* If the cursor is currently visible, the change will be immediately
* represented on the display.
*/
extern DECLSPEC void SDLCALL SDL_SetCursor(SDL_Cursor *cursor);
/*
* Returns the currently active cursor.
*/
extern DECLSPEC SDL_Cursor * SDLCALL SDL_GetCursor(void);
/*
* Deallocates a cursor created with SDL_CreateCursor().
*/
extern DECLSPEC void SDLCALL SDL_FreeCursor(SDL_Cursor *cursor);
/*
* Toggle whether or not the cursor is shown on the screen.
* The cursor start off displayed, but can be turned off.
* SDL_ShowCursor() returns 1 if the cursor was being displayed
* before the call, or 0 if it was not. You can query the current
* state by passing a 'toggle' value of -1.
*/
extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle);
/* Used as a mask when testing buttons in buttonstate
Button 1: Left mouse button
Button 2: Middle mouse button
Button 3: Right mouse button
Button 4: Mouse wheel up (may also be a real button)
Button 5: Mouse wheel down (may also be a real button)
*/
#define SDL_BUTTON(X) (1 << ((X)-1))
#define SDL_BUTTON_LEFT 1
#define SDL_BUTTON_MIDDLE 2
#define SDL_BUTTON_RIGHT 3
#define SDL_BUTTON_WHEELUP 4
#define SDL_BUTTON_WHEELDOWN 5
#define SDL_BUTTON_LMASK SDL_BUTTON(SDL_BUTTON_LEFT)
#define SDL_BUTTON_MMASK SDL_BUTTON(SDL_BUTTON_MIDDLE)
#define SDL_BUTTON_RMASK SDL_BUTTON(SDL_BUTTON_RIGHT)
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif /* _SDL_mouse_h */

View File

@ -1,162 +0,0 @@
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#ifndef _SDL_mutex_h
#define _SDL_mutex_h
/* Functions to provide thread synchronization primitives
These are independent of the other SDL routines.
*/
#include "SDL_stdinc.h"
#include "SDL_error.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
/* Synchronization functions which can time out return this value
if they time out.
*/
#define SDL_MUTEX_TIMEDOUT 1
/* This is the timeout value which corresponds to never time out */
#define SDL_MUTEX_MAXWAIT (~(Uint32)0)
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* Mutex functions */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* The SDL mutex structure, defined in SDL_mutex.c */
struct SDL_mutex;
typedef struct SDL_mutex SDL_mutex;
/* Create a mutex, initialized unlocked */
extern DECLSPEC SDL_mutex * SDLCALL SDL_CreateMutex(void);
/* Lock the mutex (Returns 0, or -1 on error) */
#define SDL_LockMutex(m) SDL_mutexP(m)
extern DECLSPEC int SDLCALL SDL_mutexP(SDL_mutex *mutex);
/* Unlock the mutex (Returns 0, or -1 on error)
It is an error to unlock a mutex that has not been locked by
the current thread, and doing so results in undefined behavior.
*/
#define SDL_UnlockMutex(m) SDL_mutexV(m)
extern DECLSPEC int SDLCALL SDL_mutexV(SDL_mutex *mutex);
/* Destroy a mutex */
extern DECLSPEC void SDLCALL SDL_DestroyMutex(SDL_mutex *mutex);
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* Semaphore functions */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* The SDL semaphore structure, defined in SDL_sem.c */
struct SDL_semaphore;
typedef struct SDL_semaphore SDL_sem;
/* Create a semaphore, initialized with value, returns NULL on failure. */
extern DECLSPEC SDL_sem * SDLCALL SDL_CreateSemaphore(Uint32 initial_value);
/* Destroy a semaphore */
extern DECLSPEC void SDLCALL SDL_DestroySemaphore(SDL_sem *sem);
/* This function suspends the calling thread until the semaphore pointed
* to by sem has a positive count. It then atomically decreases the semaphore
* count.
*/
extern DECLSPEC int SDLCALL SDL_SemWait(SDL_sem *sem);
/* Non-blocking variant of SDL_SemWait(), returns 0 if the wait succeeds,
SDL_MUTEX_TIMEDOUT if the wait would block, and -1 on error.
*/
extern DECLSPEC int SDLCALL SDL_SemTryWait(SDL_sem *sem);
/* Variant of SDL_SemWait() with a timeout in milliseconds, returns 0 if
the wait succeeds, SDL_MUTEX_TIMEDOUT if the wait does not succeed in
the allotted time, and -1 on error.
On some platforms this function is implemented by looping with a delay
of 1 ms, and so should be avoided if possible.
*/
extern DECLSPEC int SDLCALL SDL_SemWaitTimeout(SDL_sem *sem, Uint32 ms);
/* Atomically increases the semaphore's count (not blocking), returns 0,
or -1 on error.
*/
extern DECLSPEC int SDLCALL SDL_SemPost(SDL_sem *sem);
/* Returns the current count of the semaphore */
extern DECLSPEC Uint32 SDLCALL SDL_SemValue(SDL_sem *sem);
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* Condition variable functions */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* The SDL condition variable structure, defined in SDL_cond.c */
struct SDL_cond;
typedef struct SDL_cond SDL_cond;
/* Create a condition variable */
extern DECLSPEC SDL_cond * SDLCALL SDL_CreateCond(void);
/* Destroy a condition variable */
extern DECLSPEC void SDLCALL SDL_DestroyCond(SDL_cond *cond);
/* Restart one of the threads that are waiting on the condition variable,
returns 0 or -1 on error.
*/
extern DECLSPEC int SDLCALL SDL_CondSignal(SDL_cond *cond);
/* Restart all threads that are waiting on the condition variable,
returns 0 or -1 on error.
*/
extern DECLSPEC int SDLCALL SDL_CondBroadcast(SDL_cond *cond);
/* Wait on the condition variable, unlocking the provided mutex.
The mutex must be locked before entering this function!
The mutex is re-locked once the condition variable is signaled.
Returns 0 when it is signaled, or -1 on error.
*/
extern DECLSPEC int SDLCALL SDL_CondWait(SDL_cond *cond, SDL_mutex *mut);
/* Waits for at most 'ms' milliseconds, and returns 0 if the condition
variable is signaled, SDL_MUTEX_TIMEDOUT if the condition is not
signaled in the allotted time, and -1 on error.
On some platforms this function is implemented by looping with a delay
of 1 ms, and so should be avoided if possible.
*/
extern DECLSPEC int SDLCALL SDL_CondWaitTimeout(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif /* _SDL_mutex_h */

View File

@ -1,11 +0,0 @@
#ifndef _SDLname_h_
#define _SDLname_h_
#if defined(__STDC__) || defined(__cplusplus)
#define NeedFunctionPrototypes 1
#endif
#define SDL_NAME(X) SDL_##X
#endif /* _SDLname_h_ */

View File

@ -1,104 +0,0 @@
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/* Try to get a standard set of platform defines */
#ifndef _SDL_platform_h
#define _SDL_platform_h
#if defined(_AIX)
#undef __AIX__
#define __AIX__ 1
#endif
#if defined(AMIGA) || defined(__AMIGA) || defined(__amigados__)
#undef __AMIGA__
#define __AMIGA__ 1
#endif
#if defined(__BEOS__)
#undef __BEOS__
#define __BEOS__ 1
#endif
#if defined(bsdi) || defined(__bsdi) || defined(__bsdi__)
#undef __BSDI__
#define __BSDI__ 1
#endif
#if defined(_arch_dreamcast)
#undef __DREAMCAST__
#define __DREAMCAST__ 1
#endif
#if defined(__FreeBSD__) || defined(__DragonFly__)
#undef __FREEBSD__
#define __FREEBSD__ 1
#endif
#if defined(hpux) || defined(__hpux) || defined(__hpux__)
#undef __HPUX__
#define __HPUX__ 1
#endif
#if defined(sgi) || defined(__sgi) || defined(__sgi__) || defined(_SGI_SOURCE)
#undef __IRIX__
#define __IRIX__ 1
#endif
#if defined(linux) || defined(__linux) || defined(__linux__)
#undef __LINUX__
#define __LINUX__ 1
#endif
#if defined(__APPLE__)
#undef __MACOSX__
#define __MACOSX__ 1
#elif defined(macintosh)
#undef __MACOS__
#define __MACOS__ 1
#endif
#if defined(__NetBSD__)
#undef __NETBSD__
#define __NETBSD__ 1
#endif
#if defined(__OpenBSD__)
#undef __OPENBSD__
#define __OPENBSD__ 1
#endif
#if defined(__OS2__)
#undef __OS2__
#define __OS2__ 1
#endif
#if defined(osf) || defined(__osf) || defined(__osf__) || defined(_OSF_SOURCE)
#undef __OSF__
#define __OSF__ 1
#endif
#if defined(__QNXNTO__)
#undef __QNXNTO__
#define __QNXNTO__ 1
#endif
#if defined(riscos) || defined(__riscos) || defined(__riscos__)
#undef __RISCOS__
#define __RISCOS__ 1
#endif
#if defined(__SVR4)
#undef __SOLARIS__
#define __SOLARIS__ 1
#endif
#if defined(WIN32) || defined(_WIN32)
#undef __WIN32__
#define __WIN32__ 1
#endif
#endif /* _SDL_platform_h */

View File

@ -1,50 +0,0 @@
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/* Include file for SDL quit event handling */
#ifndef _SDL_quit_h
#define _SDL_quit_h
#include "SDL_stdinc.h"
#include "SDL_error.h"
/*
An SDL_QUITEVENT is generated when the user tries to close the application
window. If it is ignored or filtered out, the window will remain open.
If it is not ignored or filtered, it is queued normally and the window
is allowed to close. When the window is closed, screen updates will
complete, but have no effect.
SDL_Init() installs signal handlers for SIGINT (keyboard interrupt)
and SIGTERM (system termination request), if handlers do not already
exist, that generate SDL_QUITEVENT events as well. There is no way
to determine the cause of an SDL_QUITEVENT, but setting a signal
handler in your application will override the default generation of
quit events for that signal.
*/
/* There are no functions directly affecting the quit event */
#define SDL_QuitRequested() \
(SDL_PumpEvents(), SDL_PeepEvents(NULL,0,SDL_PEEKEVENT,SDL_QUITMASK))
#endif /* _SDL_quit_h */

View File

@ -1,139 +0,0 @@
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/* This file provides a general interface for SDL to read and write
data sources. It can easily be extended to files, memory, etc.
*/
#ifndef _SDL_rwops_h
#define _SDL_rwops_h
#include "SDL_stdinc.h"
#include "SDL_error.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
/* This is the read/write operation structure -- very basic */
typedef struct SDL_RWops {
/* Seek to 'offset' relative to whence, one of stdio's whence values:
SEEK_SET, SEEK_CUR, SEEK_END
Returns the final offset in the data source.
*/
int (SDLCALL *seek)(struct SDL_RWops *context, int offset, int whence);
/* Read up to 'num' objects each of size 'objsize' from the data
source to the area pointed at by 'ptr'.
Returns the number of objects read, or -1 if the read failed.
*/
int (SDLCALL *read)(struct SDL_RWops *context, void *ptr, int size, int maxnum);
/* Write exactly 'num' objects each of size 'objsize' from the area
pointed at by 'ptr' to data source.
Returns 'num', or -1 if the write failed.
*/
int (SDLCALL *write)(struct SDL_RWops *context, const void *ptr, int size, int num);
/* Close and free an allocated SDL_FSops structure */
int (SDLCALL *close)(struct SDL_RWops *context);
Uint32 type;
union {
#ifdef __WIN32__
struct {
int append;
void* h;
} win32io;
#endif
#ifdef HAVE_STDIO_H
struct {
int autoclose;
FILE *fp;
} stdio;
#endif
struct {
Uint8 *base;
Uint8 *here;
Uint8 *stop;
} mem;
struct {
void *data1;
} unknown;
} hidden;
} SDL_RWops;
/* Functions to create SDL_RWops structures from various data sources */
extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromFile(const char *file, const char *mode);
#ifdef HAVE_STDIO_H
extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromFP(FILE *fp, int autoclose);
#endif
extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromMem(void *mem, int size);
extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromConstMem(const void *mem, int size);
extern DECLSPEC SDL_RWops * SDLCALL SDL_AllocRW(void);
extern DECLSPEC void SDLCALL SDL_FreeRW(SDL_RWops *area);
#define RW_SEEK_SET 0 /* Seek from the beginning of data */
#define RW_SEEK_CUR 1 /* Seek relative to current read point */
#define RW_SEEK_END 2 /* Seek relative to the end of data */
/* Macros to easily read and write from an SDL_RWops structure */
#define SDL_RWseek(ctx, offset, whence) (ctx)->seek(ctx, offset, whence)
#define SDL_RWtell(ctx) (ctx)->seek(ctx, 0, RW_SEEK_CUR)
#define SDL_RWread(ctx, ptr, size, n) (ctx)->read(ctx, ptr, size, n)
#define SDL_RWwrite(ctx, ptr, size, n) (ctx)->write(ctx, ptr, size, n)
#define SDL_RWclose(ctx) (ctx)->close(ctx)
/* Read an item of the specified endianness and return in native format */
extern DECLSPEC Uint16 SDLCALL SDL_ReadLE16(SDL_RWops *src);
extern DECLSPEC Uint16 SDLCALL SDL_ReadBE16(SDL_RWops *src);
extern DECLSPEC Uint32 SDLCALL SDL_ReadLE32(SDL_RWops *src);
extern DECLSPEC Uint32 SDLCALL SDL_ReadBE32(SDL_RWops *src);
extern DECLSPEC Uint64 SDLCALL SDL_ReadLE64(SDL_RWops *src);
extern DECLSPEC Uint64 SDLCALL SDL_ReadBE64(SDL_RWops *src);
/* Write an item of native format to the specified endianness */
extern DECLSPEC int SDLCALL SDL_WriteLE16(SDL_RWops *dst, Uint16 value);
extern DECLSPEC int SDLCALL SDL_WriteBE16(SDL_RWops *dst, Uint16 value);
extern DECLSPEC int SDLCALL SDL_WriteLE32(SDL_RWops *dst, Uint32 value);
extern DECLSPEC int SDLCALL SDL_WriteBE32(SDL_RWops *dst, Uint32 value);
extern DECLSPEC int SDLCALL SDL_WriteLE64(SDL_RWops *dst, Uint64 value);
extern DECLSPEC int SDLCALL SDL_WriteBE64(SDL_RWops *dst, Uint64 value);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif /* _SDL_rwops_h */

View File

@ -1,586 +0,0 @@
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/* This is a general header that includes C language support */
#ifndef _SDL_stdinc_h
#define _SDL_stdinc_h
#include "SDL_config.h"
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_STDIO_H
#include <stdio.h>
#endif
#if defined(STDC_HEADERS)
# include <stdlib.h>
# include <stddef.h>
# include <stdarg.h>
#else
# if defined(HAVE_STDLIB_H)
# include <stdlib.h>
# elif defined(HAVE_MALLOC_H)
# include <malloc.h>
# endif
# if defined(HAVE_STDDEF_H)
# include <stddef.h>
# endif
# if defined(HAVE_STDARG_H)
# include <stdarg.h>
# endif
#endif
#ifdef HAVE_STRING_H
# if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H)
# include <memory.h>
# endif
# include <string.h>
#endif
#ifdef HAVE_STRINGS_H
# include <strings.h>
#endif
#if defined(HAVE_INTTYPES_H)
# include <inttypes.h>
#elif defined(HAVE_STDINT_H)
# include <stdint.h>
#endif
#ifdef HAVE_CTYPE_H
# include <ctype.h>
#endif
#ifdef HAVE_ICONV_H
# include <iconv.h>
#endif
/* The number of elements in an array */
#define SDL_arraysize(array) (sizeof(array)/sizeof(array[0]))
#define SDL_TABLESIZE(table) SDL_arraysize(table)
/* Basic data types */
typedef enum SDL_bool {
SDL_FALSE = 0,
SDL_TRUE = 1
} SDL_bool;
typedef int8_t Sint8;
typedef uint8_t Uint8;
typedef int16_t Sint16;
typedef uint16_t Uint16;
typedef int32_t Sint32;
typedef uint32_t Uint32;
#ifdef SDL_HAS_64BIT_TYPE
typedef int64_t Sint64;
typedef uint64_t Uint64;
#else
/* This is really just a hack to prevent the compiler from complaining */
typedef struct {
Uint32 hi;
Uint32 lo;
} Uint64, Sint64;
#endif
/* Make sure the types really have the right sizes */
#define SDL_COMPILE_TIME_ASSERT(name, x) \
typedef int SDL_dummy_ ## name[(x) * 2 - 1]
SDL_COMPILE_TIME_ASSERT(uint8, sizeof(Uint8) == 1);
SDL_COMPILE_TIME_ASSERT(sint8, sizeof(Sint8) == 1);
SDL_COMPILE_TIME_ASSERT(uint16, sizeof(Uint16) == 2);
SDL_COMPILE_TIME_ASSERT(sint16, sizeof(Sint16) == 2);
SDL_COMPILE_TIME_ASSERT(uint32, sizeof(Uint32) == 4);
SDL_COMPILE_TIME_ASSERT(sint32, sizeof(Sint32) == 4);
SDL_COMPILE_TIME_ASSERT(uint64, sizeof(Uint64) == 8);
SDL_COMPILE_TIME_ASSERT(sint64, sizeof(Sint64) == 8);
/* Check to make sure enums are the size of ints, for structure packing.
For both Watcom C/C++ and Borland C/C++ the compiler option that makes
enums having the size of an int must be enabled.
This is "-b" for Borland C/C++ and "-ei" for Watcom C/C++ (v11).
*/
/* Enable enums always int in CodeWarrior (for MPW use "-enum int") */
#ifdef __MWERKS__
#pragma enumsalwaysint on
#endif
typedef enum {
DUMMY_ENUM_VALUE
} SDL_DUMMY_ENUM;
SDL_COMPILE_TIME_ASSERT(enum, sizeof(SDL_DUMMY_ENUM) == sizeof(int));
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
#ifdef HAVE_MALLOC
#define SDL_malloc malloc
#else
extern DECLSPEC void * SDLCALL SDL_malloc(size_t size);
#endif
#ifdef HAVE_CALLOC
#define SDL_calloc calloc
#else
extern DECLSPEC void * SDLCALL SDL_calloc(size_t nmemb, size_t size);
#endif
#ifdef HAVE_REALLOC
#define SDL_realloc realloc
#else
extern DECLSPEC void * SDLCALL SDL_realloc(void *mem, size_t size);
#endif
#ifdef HAVE_FREE
#define SDL_free free
#else
extern DECLSPEC void SDLCALL SDL_free(void *mem);
#endif
#if defined(HAVE_ALLOCA) && !defined(alloca)
# if defined(HAVE_ALLOCA_H)
# include <alloca.h>
# elif defined(__GNUC__)
# define alloca __builtin_alloca
# elif defined(_MSC_VER)
# include <malloc.h>
# define alloca _alloca
# elif defined(__WATCOMC__)
# include <malloc.h>
# elif defined(__DMC__)
# include <stdlib.h>
# elif defined(__AIX__)
#pragma alloca
# elif defined(__MRC__)
void *alloca (unsigned);
# else
char *alloca ();
# endif
#endif
#ifdef HAVE_ALLOCA
#define SDL_stack_alloc(type, count) (type*)alloca(sizeof(type)*count)
#define SDL_stack_free(data)
#else
#define SDL_stack_alloc(type, count) (type*)SDL_malloc(sizeof(type)*count)
#define SDL_stack_free(data) SDL_free(data)
#endif
#ifdef HAVE_GETENV
#define SDL_getenv getenv
#else
extern DECLSPEC char * SDLCALL SDL_getenv(const char *name);
#endif
#ifdef HAVE_PUTENV
#define SDL_putenv putenv
#else
extern DECLSPEC int SDLCALL SDL_putenv(const char *variable);
#endif
#ifdef HAVE_QSORT
#define SDL_qsort qsort
#else
extern DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size,
int (*compare)(const void *, const void *));
#endif
#ifdef HAVE_ABS
#define SDL_abs abs
#else
#define SDL_abs(X) ((X) < 0 ? -(X) : (X))
#endif
#define SDL_min(x, y) (((x) < (y)) ? (x) : (y))
#define SDL_max(x, y) (((x) > (y)) ? (x) : (y))
#ifdef HAVE_CTYPE_H
#define SDL_isdigit(X) isdigit(X)
#define SDL_isspace(X) isspace(X)
#define SDL_toupper(X) toupper(X)
#define SDL_tolower(X) tolower(X)
#else
#define SDL_isdigit(X) (((X) >= '0') && ((X) <= '9'))
#define SDL_isspace(X) (((X) == ' ') || ((X) == '\t') || ((X) == '\r') || ((X) == '\n'))
#define SDL_toupper(X) (((X) >= 'a') && ((X) <= 'z') ? ('A'+((X)-'a')) : (X))
#define SDL_tolower(X) (((X) >= 'A') && ((X) <= 'Z') ? ('a'+((X)-'A')) : (X))
#endif
#ifdef HAVE_MEMSET
#define SDL_memset memset
#else
extern DECLSPEC void * SDLCALL SDL_memset(void *dst, int c, size_t len);
#endif
#if defined(__GNUC__) && defined(i386)
#define SDL_memset4(dst, val, len) \
do { \
int u0, u1, u2; \
__asm__ __volatile__ ( \
"cld\n\t" \
"rep ; stosl\n\t" \
: "=&D" (u0), "=&a" (u1), "=&c" (u2) \
: "0" (dst), "1" (val), "2" ((Uint32)(len)) \
: "memory" ); \
} while(0)
#endif
#ifndef SDL_memset4
#define SDL_memset4(dst, val, len) \
do { \
unsigned _count = (len); \
unsigned _n = (_count + 3) / 4; \
Uint32 *_p = (Uint32 *)(dst); \
Uint32 _val = (val); \
switch (_count % 4) { \
case 0: do { *_p++ = _val; \
case 3: *_p++ = _val; \
case 2: *_p++ = _val; \
case 1: *_p++ = _val; \
} while ( --_n ); \
} \
} while(0)
#endif
#if defined(__GNUC__) && defined(i386)
#define SDL_memcpy(dst, src, len) \
do { \
int u0, u1, u2; \
__asm__ __volatile__ ( \
"cld\n\t" \
"rep ; movsl\n\t" \
"testb $2,%b4\n\t" \
"je 1f\n\t" \
"movsw\n" \
"1:\ttestb $1,%b4\n\t" \
"je 2f\n\t" \
"movsb\n" \
"2:" \
: "=&c" (u0), "=&D" (u1), "=&S" (u2) \
: "0" ((unsigned)(len)/4), "q" (len), "1" (dst),"2" (src) \
: "memory" ); \
} while(0)
#endif
#ifndef SDL_memcpy
#ifdef HAVE_MEMCPY
#define SDL_memcpy memcpy
#elif defined(HAVE_BCOPY)
#define SDL_memcpy(d, s, n) bcopy((s), (d), (n))
#else
extern DECLSPEC void * SDLCALL SDL_memcpy(void *dst, const void *src, size_t len);
#endif
#endif
#if defined(__GNUC__) && defined(i386)
#define SDL_memcpy4(dst, src, len) \
do { \
int ecx, edi, esi; \
__asm__ __volatile__ ( \
"cld\n\t" \
"rep ; movsl" \
: "=&c" (ecx), "=&D" (edi), "=&S" (esi) \
: "0" ((unsigned)(len)), "1" (dst), "2" (src) \
: "memory" ); \
} while(0)
#endif
#ifndef SDL_memcpy4
#define SDL_memcpy4(dst, src, len) SDL_memcpy(dst, src, (len) << 2)
#endif
#if defined(__GNUC__) && defined(i386)
#define SDL_revcpy(dst, src, len) \
do { \
int u0, u1, u2; \
char *dstp = (char *)(dst); \
char *srcp = (char *)(src); \
int n = (len); \
if ( n >= 4 ) { \
__asm__ __volatile__ ( \
"std\n\t" \
"rep ; movsl\n\t" \
: "=&c" (u0), "=&D" (u1), "=&S" (u2) \
: "0" (n >> 2), \
"1" (dstp+(n-4)), "2" (srcp+(n-4)) \
: "memory" ); \
} \
switch (n & 3) { \
case 3: dstp[2] = srcp[2]; \
case 2: dstp[1] = srcp[1]; \
case 1: dstp[0] = srcp[0]; \
break; \
default: \
break; \
} \
} while(0)
#endif
#ifndef SDL_revcpy
extern DECLSPEC void * SDLCALL SDL_revcpy(void *dst, const void *src, size_t len);
#endif
#ifdef HAVE_MEMMOVE
#define SDL_memmove memmove
#elif defined(HAVE_BCOPY)
#define SDL_memmove(d, s, n) bcopy((s), (d), (n))
#else
#define SDL_memmove(dst, src, len) \
do { \
if ( dst < src ) { \
SDL_memcpy(dst, src, len); \
} else { \
SDL_revcpy(dst, src, len); \
} \
} while(0)
#endif
#ifdef HAVE_MEMCMP
#define SDL_memcmp memcmp
#else
extern DECLSPEC int SDLCALL SDL_memcmp(const void *s1, const void *s2, size_t len);
#endif
#ifdef HAVE_STRLEN
#define SDL_strlen strlen
#else
extern DECLSPEC size_t SDLCALL SDL_strlen(const char *string);
#endif
#ifdef HAVE_STRLCPY
#define SDL_strlcpy strlcpy
#else
extern DECLSPEC size_t SDLCALL SDL_strlcpy(char *dst, const char *src, size_t maxlen);
#endif
#ifdef HAVE_STRLCAT
#define SDL_strlcat strlcat
#else
extern DECLSPEC size_t SDLCALL SDL_strlcat(char *dst, const char *src, size_t maxlen);
#endif
#ifdef HAVE_STRDUP
#define SDL_strdup strdup
#else
extern DECLSPEC char * SDLCALL SDL_strdup(const char *string);
#endif
#ifdef HAVE__STRREV
#define SDL_strrev _strrev
#else
extern DECLSPEC char * SDLCALL SDL_strrev(char *string);
#endif
#ifdef HAVE__STRUPR
#define SDL_strupr _strupr
#else
extern DECLSPEC char * SDLCALL SDL_strupr(char *string);
#endif
#ifdef HAVE__STRLWR
#define SDL_strlwr _strlwr
#else
extern DECLSPEC char * SDLCALL SDL_strlwr(char *string);
#endif
#ifdef HAVE_STRCHR
#define SDL_strchr strchr
#elif defined(HAVE_INDEX)
#define SDL_strchr index
#else
extern DECLSPEC char * SDLCALL SDL_strchr(const char *string, int c);
#endif
#ifdef HAVE_STRRCHR
#define SDL_strrchr strrchr
#elif defined(HAVE_RINDEX)
#define SDL_strrchr rindex
#else
extern DECLSPEC char * SDLCALL SDL_strrchr(const char *string, int c);
#endif
#ifdef HAVE_STRSTR
#define SDL_strstr strstr
#else
extern DECLSPEC char * SDLCALL SDL_strstr(const char *haystack, const char *needle);
#endif
#ifdef HAVE_ITOA
#define SDL_itoa itoa
#else
#define SDL_itoa(value, string, radix) SDL_ltoa((long)value, string, radix)
#endif
#ifdef HAVE__LTOA
#define SDL_ltoa _ltoa
#else
extern DECLSPEC char * SDLCALL SDL_ltoa(long value, char *string, int radix);
#endif
#ifdef HAVE__UITOA
#define SDL_uitoa _uitoa
#else
#define SDL_uitoa(value, string, radix) SDL_ultoa((long)value, string, radix)
#endif
#ifdef HAVE__ULTOA
#define SDL_ultoa _ultoa
#else
extern DECLSPEC char * SDLCALL SDL_ultoa(unsigned long value, char *string, int radix);
#endif
#ifdef HAVE_STRTOL
#define SDL_strtol strtol
#else
extern DECLSPEC long SDLCALL SDL_strtol(const char *string, char **endp, int base);
#endif
#ifdef HAVE_STRTOUL
#define SDL_strtoul strtoul
#else
extern DECLSPEC unsigned long SDLCALL SDL_strtoul(const char *string, char **endp, int base);
#endif
#ifdef SDL_HAS_64BIT_TYPE
#ifdef HAVE__I64TOA
#define SDL_lltoa _i64toa
#else
extern DECLSPEC char* SDLCALL SDL_lltoa(Sint64 value, char *string, int radix);
#endif
#ifdef HAVE__UI64TOA
#define SDL_ulltoa _ui64toa
#else
extern DECLSPEC char* SDLCALL SDL_ulltoa(Uint64 value, char *string, int radix);
#endif
#ifdef HAVE_STRTOLL
#define SDL_strtoll strtoll
#else
extern DECLSPEC Sint64 SDLCALL SDL_strtoll(const char *string, char **endp, int base);
#endif
#ifdef HAVE_STRTOULL
#define SDL_strtoull strtoull
#else
extern DECLSPEC Uint64 SDLCALL SDL_strtoull(const char *string, char **endp, int base);
#endif
#endif /* SDL_HAS_64BIT_TYPE */
#ifdef HAVE_STRTOD
#define SDL_strtod strtod
#else
extern DECLSPEC double SDLCALL SDL_strtod(const char *string, char **endp);
#endif
#ifdef HAVE_ATOI
#define SDL_atoi atoi
#else
#define SDL_atoi(X) SDL_strtol(X, NULL, 0)
#endif
#ifdef HAVE_ATOF
#define SDL_atof atof
#else
#define SDL_atof(X) SDL_strtod(X, NULL)
#endif
#ifdef HAVE_STRCMP
#define SDL_strcmp strcmp
#else
extern DECLSPEC int SDLCALL SDL_strcmp(const char *str1, const char *str2);
#endif
#ifdef HAVE_STRNCMP
#define SDL_strncmp strncmp
#else
extern DECLSPEC int SDLCALL SDL_strncmp(const char *str1, const char *str2, size_t maxlen);
#endif
#ifdef HAVE_STRCASECMP
#define SDL_strcasecmp strcasecmp
#elif defined(HAVE__STRICMP)
#define SDL_strcasecmp _stricmp
#else
extern DECLSPEC int SDLCALL SDL_strcasecmp(const char *str1, const char *str2);
#endif
#ifdef HAVE_STRNCASECMP
#define SDL_strncasecmp strncasecmp
#elif defined(HAVE__STRNICMP)
#define SDL_strncasecmp _strnicmp
#else
extern DECLSPEC int SDLCALL SDL_strncasecmp(const char *str1, const char *str2, size_t maxlen);
#endif
#ifdef HAVE_SSCANF
#define SDL_sscanf sscanf
#else
extern DECLSPEC int SDLCALL SDL_sscanf(const char *text, const char *fmt, ...);
#endif
#ifdef HAVE_SNPRINTF
#define SDL_snprintf snprintf
#else
extern DECLSPEC int SDLCALL SDL_snprintf(char *text, size_t maxlen, const char *fmt, ...);
#endif
#ifdef HAVE_VSNPRINTF
#define SDL_vsnprintf vsnprintf
#else
extern DECLSPEC int SDLCALL SDL_vsnprintf(char *text, size_t maxlen, const char *fmt, va_list ap);
#endif
/* The SDL implementation of iconv() returns these error codes */
#define SDL_ICONV_ERROR (size_t)-1
#define SDL_ICONV_E2BIG (size_t)-2
#define SDL_ICONV_EILSEQ (size_t)-3
#define SDL_ICONV_EINVAL (size_t)-4
#ifdef HAVE_ICONV
#define SDL_iconv_t iconv_t
#define SDL_iconv_open iconv_open
#define SDL_iconv_close iconv_close
extern DECLSPEC size_t SDLCALL SDL_iconv(SDL_iconv_t cd, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft);
#else
typedef struct _SDL_iconv_t *SDL_iconv_t;
extern DECLSPEC SDL_iconv_t SDLCALL SDL_iconv_open(const char *tocode, const char *fromcode);
extern DECLSPEC int SDLCALL SDL_iconv_close(SDL_iconv_t cd);
extern DECLSPEC size_t SDLCALL SDL_iconv(SDL_iconv_t cd, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft);
#endif
/* This function converts a string between encodings in one pass, returning a
string that must be freed with SDL_free() or NULL on error.
*/
extern DECLSPEC char * SDLCALL SDL_iconv_string(const char *tocode, const char *fromcode, char *inbuf, size_t inbytesleft);
#define SDL_iconv_utf8_ascii(S) SDL_iconv_string("ASCII", "UTF-8", S, SDL_strlen(S)+1)
#define SDL_iconv_utf8_latin1(S) SDL_iconv_string("LATIN1", "UTF-8", S, SDL_strlen(S)+1)
#define SDL_iconv_utf8_ucs2(S) (Uint16 *)SDL_iconv_string("UCS-2", "UTF-8", S, SDL_strlen(S)+1)
#define SDL_iconv_utf8_ucs4(S) (Uint32 *)SDL_iconv_string("UCS-4", "UTF-8", S, SDL_strlen(S)+1)
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif /* _SDL_stdinc_h */

View File

@ -1,210 +0,0 @@
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/* Include file for SDL custom system window manager hooks */
#ifndef _SDL_syswm_h
#define _SDL_syswm_h
#include "SDL_stdinc.h"
#include "SDL_error.h"
#include "SDL_version.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
/* Your application has access to a special type of event 'SDL_SYSWMEVENT',
which contains window-manager specific information and arrives whenever
an unhandled window event occurs. This event is ignored by default, but
you can enable it with SDL_EventState()
*/
#ifdef SDL_PROTOTYPES_ONLY
struct SDL_SysWMinfo;
typedef struct SDL_SysWMinfo SDL_SysWMinfo;
#else
/* This is the structure for custom window manager events */
#if defined(SDL_VIDEO_DRIVER_X11)
#if defined(__APPLE__) && defined(__MACH__)
/* conflicts with Quickdraw.h */
#define Cursor X11Cursor
#endif
#include <X11/Xlib.h>
#include <X11/Xatom.h>
#if defined(__APPLE__) && defined(__MACH__)
/* matches the re-define above */
#undef Cursor
#endif
/* These are the various supported subsystems under UNIX */
typedef enum {
SDL_SYSWM_X11
} SDL_SYSWM_TYPE;
/* The UNIX custom event structure */
struct SDL_SysWMmsg {
SDL_version version;
SDL_SYSWM_TYPE subsystem;
union {
XEvent xevent;
} event;
};
/* The UNIX custom window manager information structure.
When this structure is returned, it holds information about which
low level system it is using, and will be one of SDL_SYSWM_TYPE.
*/
typedef struct SDL_SysWMinfo {
SDL_version version;
SDL_SYSWM_TYPE subsystem;
union {
struct {
Display *display; /* The X11 display */
Window window; /* The X11 display window */
/* These locking functions should be called around
any X11 functions using the display variable.
They lock the event thread, so should not be
called around event functions or from event filters.
*/
void (*lock_func)(void);
void (*unlock_func)(void);
/* Introduced in SDL 1.0.2 */
Window fswindow; /* The X11 fullscreen window */
Window wmwindow; /* The X11 managed input window */
} x11;
} info;
} SDL_SysWMinfo;
#elif defined(SDL_VIDEO_DRIVER_NANOX)
#include <microwin/nano-X.h>
/* The generic custom event structure */
struct SDL_SysWMmsg {
SDL_version version;
int data;
};
/* The windows custom window manager information structure */
typedef struct SDL_SysWMinfo {
SDL_version version ;
GR_WINDOW_ID window ; /* The display window */
} SDL_SysWMinfo;
#elif defined(SDL_VIDEO_DRIVER_WINDIB) || defined(SDL_VIDEO_DRIVER_DDRAW) || defined(SDL_VIDEO_DRIVER_GAPI)
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
/* The windows custom event structure */
struct SDL_SysWMmsg {
SDL_version version;
HWND hwnd; /* The window for the message */
UINT msg; /* The type of message */
WPARAM wParam; /* WORD message parameter */
LPARAM lParam; /* LONG message parameter */
};
/* The windows custom window manager information structure */
typedef struct SDL_SysWMinfo {
SDL_version version;
HWND window; /* The Win32 display window */
HGLRC hglrc; /* The OpenGL context, if any */
} SDL_SysWMinfo;
#elif defined(SDL_VIDEO_DRIVER_RISCOS)
/* RISC OS custom event structure */
struct SDL_SysWMmsg {
SDL_version version;
int eventCode; /* The window for the message */
int pollBlock[64];
};
/* The RISC OS custom window manager information structure */
typedef struct SDL_SysWMinfo {
SDL_version version;
int wimpVersion; /* Wimp version running under */
int taskHandle; /* The RISC OS task handle */
int window; /* The RISC OS display window */
} SDL_SysWMinfo;
#elif defined(SDL_VIDEO_DRIVER_PHOTON)
#include <sys/neutrino.h>
#include <Ph.h>
/* The QNX custom event structure */
struct SDL_SysWMmsg {
SDL_version version;
int data;
};
/* The QNX custom window manager information structure */
typedef struct SDL_SysWMinfo {
SDL_version version;
int data;
} SDL_SysWMinfo;
#else
/* The generic custom event structure */
struct SDL_SysWMmsg {
SDL_version version;
int data;
};
/* The generic custom window manager information structure */
typedef struct SDL_SysWMinfo {
SDL_version version;
int data;
} SDL_SysWMinfo;
#endif /* video driver type */
#endif /* SDL_PROTOTYPES_ONLY */
/* Function prototypes */
/*
* This function gives you custom hooks into the window manager information.
* It fills the structure pointed to by 'info' with custom information and
* returns 1 if the function is implemented. If it's not implemented, or
* the version member of the 'info' structure is invalid, it returns 0.
*
* You typically use this function like this:
* SDL_SysWMInfo info;
* SDL_VERSION(&info.version);
* if ( SDL_GetWMInfo(&info) ) { ... }
*/
extern DECLSPEC int SDLCALL SDL_GetWMInfo(SDL_SysWMinfo *info);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif /* _SDL_syswm_h */

View File

@ -1,119 +0,0 @@
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#ifndef _SDL_thread_h
#define _SDL_thread_h
/* Header for the SDL thread management routines
These are independent of the other SDL routines.
*/
#include "SDL_stdinc.h"
#include "SDL_error.h"
/* Thread synchronization primitives */
#include "SDL_mutex.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
/* The SDL thread structure, defined in SDL_thread.c */
struct SDL_Thread;
typedef struct SDL_Thread SDL_Thread;
/* Create a thread */
#if (defined(__WIN32__) && !defined(HAVE_LIBC)) || defined(__OS2__)
/*
We compile SDL into a DLL on OS/2. This means, that it's the DLL which
creates a new thread for the calling process with the SDL_CreateThread()
API. There is a problem with this, that only the RTL of the SDL.DLL will
be initialized for those threads, and not the RTL of the calling application!
To solve this, we make a little hack here.
We'll always use the caller's _beginthread() and _endthread() APIs to
start a new thread. This way, if it's the SDL.DLL which uses this API,
then the RTL of SDL.DLL will be used to create the new thread, and if it's
the application, then the RTL of the application will be used.
So, in short:
Always use the _beginthread() and _endthread() of the calling runtime library!
*/
#define SDL_PASSED_BEGINTHREAD_ENDTHREAD
#ifndef _WIN32_WCE
#include <process.h> /* This has _beginthread() and _endthread() defined! */
#endif
#ifdef __OS2__
typedef int (*pfnSDL_CurrentBeginThread)(void (*func)(void *), void *, unsigned, void *arg);
typedef void (*pfnSDL_CurrentEndThread)(void);
#elif __GNUC__
typedef unsigned long (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned,
unsigned (__stdcall *func)(void *), void *arg,
unsigned, unsigned *threadID);
typedef void (__cdecl *pfnSDL_CurrentEndThread)(unsigned code);
#else
typedef uintptr_t (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned,
unsigned (__stdcall *func)(void *), void *arg,
unsigned, unsigned *threadID);
typedef void (__cdecl *pfnSDL_CurrentEndThread)(unsigned code);
#endif
extern DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(int (SDLCALL *fn)(void *), void *data, pfnSDL_CurrentBeginThread pfnBeginThread, pfnSDL_CurrentEndThread pfnEndThread);
#ifdef __OS2__
#define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, _beginthread, _endthread)
#elif defined(_WIN32_WCE)
#define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, NULL, NULL)
#else
#define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, _beginthreadex, _endthreadex)
#endif
#else
extern DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(int (SDLCALL *fn)(void *), void *data);
#endif
/* Get the 32-bit thread identifier for the current thread */
extern DECLSPEC Uint32 SDLCALL SDL_ThreadID(void);
/* Get the 32-bit thread identifier for the specified thread,
equivalent to SDL_ThreadID() if the specified thread is NULL.
*/
extern DECLSPEC Uint32 SDLCALL SDL_GetThreadID(SDL_Thread *thread);
/* Wait for a thread to finish.
The return code for the thread function is placed in the area
pointed to by 'status', if 'status' is not NULL.
*/
extern DECLSPEC void SDLCALL SDL_WaitThread(SDL_Thread *thread, int *status);
/* Forcefully kill a thread without worrying about its state */
extern DECLSPEC void SDLCALL SDL_KillThread(SDL_Thread *thread);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif /* _SDL_thread_h */

View File

@ -1,115 +0,0 @@
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#ifndef _SDL_timer_h
#define _SDL_timer_h
/* Header for the SDL time management routines */
#include "SDL_stdinc.h"
#include "SDL_error.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
/* This is the OS scheduler timeslice, in milliseconds */
#define SDL_TIMESLICE 10
/* This is the maximum resolution of the SDL timer on all platforms */
#define TIMER_RESOLUTION 10 /* Experimentally determined */
/* Get the number of milliseconds since the SDL library initialization.
* Note that this value wraps if the program runs for more than ~49 days.
*/
extern DECLSPEC Uint32 SDLCALL SDL_GetTicks(void);
/* Wait a specified number of milliseconds before returning */
extern DECLSPEC void SDLCALL SDL_Delay(Uint32 ms);
/* Function prototype for the timer callback function */
typedef Uint32 (SDLCALL *SDL_TimerCallback)(Uint32 interval);
/* Set a callback to run after the specified number of milliseconds has
* elapsed. The callback function is passed the current timer interval
* and returns the next timer interval. If the returned value is the
* same as the one passed in, the periodic alarm continues, otherwise a
* new alarm is scheduled. If the callback returns 0, the periodic alarm
* is cancelled.
*
* To cancel a currently running timer, call SDL_SetTimer(0, NULL);
*
* The timer callback function may run in a different thread than your
* main code, and so shouldn't call any functions from within itself.
*
* The maximum resolution of this timer is 10 ms, which means that if
* you request a 16 ms timer, your callback will run approximately 20 ms
* later on an unloaded system. If you wanted to set a flag signaling
* a frame update at 30 frames per second (every 33 ms), you might set a
* timer for 30 ms:
* SDL_SetTimer((33/10)*10, flag_update);
*
* If you use this function, you need to pass SDL_INIT_TIMER to SDL_Init().
*
* Under UNIX, you should not use raise or use SIGALRM and this function
* in the same program, as it is implemented using setitimer(). You also
* should not use this function in multi-threaded applications as signals
* to multi-threaded apps have undefined behavior in some implementations.
*
* This function returns 0 if successful, or -1 if there was an error.
*/
extern DECLSPEC int SDLCALL SDL_SetTimer(Uint32 interval, SDL_TimerCallback callback);
/* New timer API, supports multiple timers
* Written by Stephane Peter <megastep@lokigames.com>
*/
/* Function prototype for the new timer callback function.
* The callback function is passed the current timer interval and returns
* the next timer interval. If the returned value is the same as the one
* passed in, the periodic alarm continues, otherwise a new alarm is
* scheduled. If the callback returns 0, the periodic alarm is cancelled.
*/
typedef Uint32 (SDLCALL *SDL_NewTimerCallback)(Uint32 interval, void *param);
/* Definition of the timer ID type */
typedef struct _SDL_TimerID *SDL_TimerID;
/* Add a new timer to the pool of timers already running.
Returns a timer ID, or NULL when an error occurs.
*/
extern DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval, SDL_NewTimerCallback callback, void *param);
/* Remove one of the multiple timers knowing its ID.
* Returns a boolean value indicating success.
*/
extern DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID t);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif /* _SDL_timer_h */

View File

@ -1,24 +0,0 @@
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/* DEPRECATED */
#include "SDL_stdinc.h"

View File

@ -1,85 +0,0 @@
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/* This header defines the current SDL version */
#ifndef _SDL_version_h
#define _SDL_version_h
#include "SDL_stdinc.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
*/
#define SDL_MAJOR_VERSION 1
#define SDL_MINOR_VERSION 2
#define SDL_PATCHLEVEL 11
typedef struct SDL_version {
Uint8 major;
Uint8 minor;
Uint8 patch;
} SDL_version;
/* This macro can be used to fill a version structure with the compile-time
* version of the SDL library.
*/
#define SDL_VERSION(X) \
{ \
(X)->major = SDL_MAJOR_VERSION; \
(X)->minor = SDL_MINOR_VERSION; \
(X)->patch = SDL_PATCHLEVEL; \
}
/* This macro turns the version numbers into a numeric value:
(1,2,3) -> (1203)
This assumes that there will never be more than 100 patchlevels
*/
#define SDL_VERSIONNUM(X, Y, Z) \
((X)*1000 + (Y)*100 + (Z))
/* This is the version number macro for the current SDL version */
#define SDL_COMPILEDVERSION \
SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL)
/* This macro will evaluate to true if compiled with SDL at least X.Y.Z */
#define SDL_VERSION_ATLEAST(X, Y, Z) \
(SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z))
/* This function gets the version of the dynamically linked SDL library.
it should NOT be used to fill a version structure, instead you should
use the SDL_Version() macro.
*/
extern DECLSPEC const SDL_version * SDLCALL SDL_Linked_Version(void);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif /* _SDL_version_h */

View File

@ -1,889 +0,0 @@
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/* Header file for access to the SDL raw framebuffer window */
#ifndef _SDL_video_h
#define _SDL_video_h
#include "SDL_stdinc.h"
#include "SDL_error.h"
#include "SDL_rwops.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
/* Transparency definitions: These define alpha as the opacity of a surface */
#define SDL_ALPHA_OPAQUE 255
#define SDL_ALPHA_TRANSPARENT 0
/* Useful data types */
typedef struct SDL_Rect {
Sint16 x, y;
Uint16 w, h;
} SDL_Rect;
typedef struct SDL_Color {
Uint8 r;
Uint8 g;
Uint8 b;
Uint8 unused;
} SDL_Color;
#define SDL_Colour SDL_Color
typedef struct SDL_Palette {
int ncolors;
SDL_Color *colors;
} SDL_Palette;
/* Everything in the pixel format structure is read-only */
typedef struct SDL_PixelFormat {
SDL_Palette *palette;
Uint8 BitsPerPixel;
Uint8 BytesPerPixel;
Uint8 Rloss;
Uint8 Gloss;
Uint8 Bloss;
Uint8 Aloss;
Uint8 Rshift;
Uint8 Gshift;
Uint8 Bshift;
Uint8 Ashift;
Uint32 Rmask;
Uint32 Gmask;
Uint32 Bmask;
Uint32 Amask;
/* RGB color key information */
Uint32 colorkey;
/* Alpha value information (per-surface alpha) */
Uint8 alpha;
} SDL_PixelFormat;
/* This structure should be treated as read-only, except for 'pixels',
which, if not NULL, contains the raw pixel data for the surface.
*/
typedef struct SDL_Surface {
Uint32 flags; /* Read-only */
SDL_PixelFormat *format; /* Read-only */
int w, h; /* Read-only */
Uint16 pitch; /* Read-only */
void *pixels; /* Read-write */
int offset; /* Private */
/* Hardware-specific surface info */
struct private_hwdata *hwdata;
/* clipping information */
SDL_Rect clip_rect; /* Read-only */
Uint32 unused1; /* for binary compatibility */
/* Allow recursive locks */
Uint32 locked; /* Private */
/* info for fast blit mapping to other surfaces */
struct SDL_BlitMap *map; /* Private */
/* format version, bumped at every change to invalidate blit maps */
unsigned int format_version; /* Private */
/* Reference count -- used when freeing surface */
int refcount; /* Read-mostly */
} SDL_Surface;
/* These are the currently supported flags for the SDL_surface */
/* Available for SDL_CreateRGBSurface() or SDL_SetVideoMode() */
#define SDL_SWSURFACE 0x00000000 /* Surface is in system memory */
#define SDL_HWSURFACE 0x00000001 /* Surface is in video memory */
#define SDL_ASYNCBLIT 0x00000004 /* Use asynchronous blits if possible */
/* Available for SDL_SetVideoMode() */
#define SDL_ANYFORMAT 0x10000000 /* Allow any video depth/pixel-format */
#define SDL_HWPALETTE 0x20000000 /* Surface has exclusive palette */
#define SDL_DOUBLEBUF 0x40000000 /* Set up double-buffered video mode */
#define SDL_FULLSCREEN 0x80000000 /* Surface is a full screen display */
#define SDL_OPENGL 0x00000002 /* Create an OpenGL rendering context */
#define SDL_OPENGLBLIT 0x0000000A /* Create an OpenGL rendering context and use it for blitting */
#define SDL_RESIZABLE 0x00000010 /* This video mode may be resized */
#define SDL_NOFRAME 0x00000020 /* No window caption or edge frame */
/* Used internally (read-only) */
#define SDL_HWACCEL 0x00000100 /* Blit uses hardware acceleration */
#define SDL_SRCCOLORKEY 0x00001000 /* Blit uses a source color key */
#define SDL_RLEACCELOK 0x00002000 /* Private flag */
#define SDL_RLEACCEL 0x00004000 /* Surface is RLE encoded */
#define SDL_SRCALPHA 0x00010000 /* Blit uses source alpha blending */
#define SDL_PREALLOC 0x01000000 /* Surface uses preallocated memory */
/* Evaluates to true if the surface needs to be locked before access */
#define SDL_MUSTLOCK(surface) \
(surface->offset || \
((surface->flags & (SDL_HWSURFACE|SDL_ASYNCBLIT|SDL_RLEACCEL)) != 0))
/* typedef for private surface blitting functions */
typedef int (*SDL_blit)(struct SDL_Surface *src, SDL_Rect *srcrect,
struct SDL_Surface *dst, SDL_Rect *dstrect);
/* Useful for determining the video hardware capabilities */
typedef struct SDL_VideoInfo {
Uint32 hw_available :1; /* Flag: Can you create hardware surfaces? */
Uint32 wm_available :1; /* Flag: Can you talk to a window manager? */
Uint32 UnusedBits1 :6;
Uint32 UnusedBits2 :1;
Uint32 blit_hw :1; /* Flag: Accelerated blits HW --> HW */
Uint32 blit_hw_CC :1; /* Flag: Accelerated blits with Colorkey */
Uint32 blit_hw_A :1; /* Flag: Accelerated blits with Alpha */
Uint32 blit_sw :1; /* Flag: Accelerated blits SW --> HW */
Uint32 blit_sw_CC :1; /* Flag: Accelerated blits with Colorkey */
Uint32 blit_sw_A :1; /* Flag: Accelerated blits with Alpha */
Uint32 blit_fill :1; /* Flag: Accelerated color fill */
Uint32 UnusedBits3 :16;
Uint32 video_mem; /* The total amount of video memory (in K) */
SDL_PixelFormat *vfmt; /* Value: The format of the video surface */
int current_w; /* Value: The current video mode width */
int current_h; /* Value: The current video mode height */
} SDL_VideoInfo;
/* The most common video overlay formats.
For an explanation of these pixel formats, see:
http://www.webartz.com/fourcc/indexyuv.htm
For information on the relationship between color spaces, see:
http://www.neuro.sfc.keio.ac.jp/~aly/polygon/info/color-space-faq.html
*/
#define SDL_YV12_OVERLAY 0x32315659 /* Planar mode: Y + V + U (3 planes) */
#define SDL_IYUV_OVERLAY 0x56555949 /* Planar mode: Y + U + V (3 planes) */
#define SDL_YUY2_OVERLAY 0x32595559 /* Packed mode: Y0+U0+Y1+V0 (1 plane) */
#define SDL_UYVY_OVERLAY 0x59565955 /* Packed mode: U0+Y0+V0+Y1 (1 plane) */
#define SDL_YVYU_OVERLAY 0x55595659 /* Packed mode: Y0+V0+Y1+U0 (1 plane) */
/* The YUV hardware video overlay */
typedef struct SDL_Overlay {
Uint32 format; /* Read-only */
int w, h; /* Read-only */
int planes; /* Read-only */
Uint16 *pitches; /* Read-only */
Uint8 **pixels; /* Read-write */
/* Hardware-specific surface info */
struct private_yuvhwfuncs *hwfuncs;
struct private_yuvhwdata *hwdata;
/* Special flags */
Uint32 hw_overlay :1; /* Flag: This overlay hardware accelerated? */
Uint32 UnusedBits :31;
} SDL_Overlay;
/* Public enumeration for setting the OpenGL window attributes. */
typedef enum {
SDL_GL_RED_SIZE,
SDL_GL_GREEN_SIZE,
SDL_GL_BLUE_SIZE,
SDL_GL_ALPHA_SIZE,
SDL_GL_BUFFER_SIZE,
SDL_GL_DOUBLEBUFFER,
SDL_GL_DEPTH_SIZE,
SDL_GL_STENCIL_SIZE,
SDL_GL_ACCUM_RED_SIZE,
SDL_GL_ACCUM_GREEN_SIZE,
SDL_GL_ACCUM_BLUE_SIZE,
SDL_GL_ACCUM_ALPHA_SIZE,
SDL_GL_STEREO,
SDL_GL_MULTISAMPLEBUFFERS,
SDL_GL_MULTISAMPLESAMPLES,
SDL_GL_ACCELERATED_VISUAL,
SDL_GL_SWAP_CONTROL
} SDL_GLattr;
/* flags for SDL_SetPalette() */
#define SDL_LOGPAL 0x01
#define SDL_PHYSPAL 0x02
/* Function prototypes */
/* These functions are used internally, and should not be used unless you
* have a specific need to specify the video driver you want to use.
* You should normally use SDL_Init() or SDL_InitSubSystem().
*
* SDL_VideoInit() initializes the video subsystem -- sets up a connection
* to the window manager, etc, and determines the current video mode and
* pixel format, but does not initialize a window or graphics mode.
* Note that event handling is activated by this routine.
*
* If you use both sound and video in your application, you need to call
* SDL_Init() before opening the sound device, otherwise under Win32 DirectX,
* you won't be able to set full-screen display modes.
*/
extern DECLSPEC int SDLCALL SDL_VideoInit(const char *driver_name, Uint32 flags);
extern DECLSPEC void SDLCALL SDL_VideoQuit(void);
/* This function fills the given character buffer with the name of the
* video driver, and returns a pointer to it if the video driver has
* been initialized. It returns NULL if no driver has been initialized.
*/
extern DECLSPEC char * SDLCALL SDL_VideoDriverName(char *namebuf, int maxlen);
/*
* This function returns a pointer to the current display surface.
* If SDL is doing format conversion on the display surface, this
* function returns the publicly visible surface, not the real video
* surface.
*/
extern DECLSPEC SDL_Surface * SDLCALL SDL_GetVideoSurface(void);
/*
* This function returns a read-only pointer to information about the
* video hardware. If this is called before SDL_SetVideoMode(), the 'vfmt'
* member of the returned structure will contain the pixel format of the
* "best" video mode.
*/
extern DECLSPEC const SDL_VideoInfo * SDLCALL SDL_GetVideoInfo(void);
/*
* Check to see if a particular video mode is supported.
* It returns 0 if the requested mode is not supported under any bit depth,
* or returns the bits-per-pixel of the closest available mode with the
* given width and height. If this bits-per-pixel is different from the
* one used when setting the video mode, SDL_SetVideoMode() will succeed,
* but will emulate the requested bits-per-pixel with a shadow surface.
*
* The arguments to SDL_VideoModeOK() are the same ones you would pass to
* SDL_SetVideoMode()
*/
extern DECLSPEC int SDLCALL SDL_VideoModeOK(int width, int height, int bpp, Uint32 flags);
/*
* Return a pointer to an array of available screen dimensions for the
* given format and video flags, sorted largest to smallest. Returns
* NULL if there are no dimensions available for a particular format,
* or (SDL_Rect **)-1 if any dimension is okay for the given format.
*
* If 'format' is NULL, the mode list will be for the format given
* by SDL_GetVideoInfo()->vfmt
*/
extern DECLSPEC SDL_Rect ** SDLCALL SDL_ListModes(SDL_PixelFormat *format, Uint32 flags);
/*
* Set up a video mode with the specified width, height and bits-per-pixel.
*
* If 'bpp' is 0, it is treated as the current display bits per pixel.
*
* If SDL_ANYFORMAT is set in 'flags', the SDL library will try to set the
* requested bits-per-pixel, but will return whatever video pixel format is
* available. The default is to emulate the requested pixel format if it
* is not natively available.
*
* If SDL_HWSURFACE is set in 'flags', the video surface will be placed in
* video memory, if possible, and you may have to call SDL_LockSurface()
* in order to access the raw framebuffer. Otherwise, the video surface
* will be created in system memory.
*
* If SDL_ASYNCBLIT is set in 'flags', SDL will try to perform rectangle
* updates asynchronously, but you must always lock before accessing pixels.
* SDL will wait for updates to complete before returning from the lock.
*
* If SDL_HWPALETTE is set in 'flags', the SDL library will guarantee
* that the colors set by SDL_SetColors() will be the colors you get.
* Otherwise, in 8-bit mode, SDL_SetColors() may not be able to set all
* of the colors exactly the way they are requested, and you should look
* at the video surface structure to determine the actual palette.
* If SDL cannot guarantee that the colors you request can be set,
* i.e. if the colormap is shared, then the video surface may be created
* under emulation in system memory, overriding the SDL_HWSURFACE flag.
*
* If SDL_FULLSCREEN is set in 'flags', the SDL library will try to set
* a fullscreen video mode. The default is to create a windowed mode
* if the current graphics system has a window manager.
* If the SDL library is able to set a fullscreen video mode, this flag
* will be set in the surface that is returned.
*
* If SDL_DOUBLEBUF is set in 'flags', the SDL library will try to set up
* two surfaces in video memory and swap between them when you call
* SDL_Flip(). This is usually slower than the normal single-buffering
* scheme, but prevents "tearing" artifacts caused by modifying video
* memory while the monitor is refreshing. It should only be used by
* applications that redraw the entire screen on every update.
*
* If SDL_RESIZABLE is set in 'flags', the SDL library will allow the
* window manager, if any, to resize the window at runtime. When this
* occurs, SDL will send a SDL_VIDEORESIZE event to you application,
* and you must respond to the event by re-calling SDL_SetVideoMode()
* with the requested size (or another size that suits the application).
*
* If SDL_NOFRAME is set in 'flags', the SDL library will create a window
* without any title bar or frame decoration. Fullscreen video modes have
* this flag set automatically.
*
* This function returns the video framebuffer surface, or NULL if it fails.
*
* If you rely on functionality provided by certain video flags, check the
* flags of the returned surface to make sure that functionality is available.
* SDL will fall back to reduced functionality if the exact flags you wanted
* are not available.
*/
extern DECLSPEC SDL_Surface * SDLCALL SDL_SetVideoMode
(int width, int height, int bpp, Uint32 flags);
/*
* Makes sure the given list of rectangles is updated on the given screen.
* If 'x', 'y', 'w' and 'h' are all 0, SDL_UpdateRect will update the entire
* screen.
* These functions should not be called while 'screen' is locked.
*/
extern DECLSPEC void SDLCALL SDL_UpdateRects
(SDL_Surface *screen, int numrects, SDL_Rect *rects);
extern DECLSPEC void SDLCALL SDL_UpdateRect
(SDL_Surface *screen, Sint32 x, Sint32 y, Uint32 w, Uint32 h);
/*
* On hardware that supports double-buffering, this function sets up a flip
* and returns. The hardware will wait for vertical retrace, and then swap
* video buffers before the next video surface blit or lock will return.
* On hardware that doesn not support double-buffering, this is equivalent
* to calling SDL_UpdateRect(screen, 0, 0, 0, 0);
* The SDL_DOUBLEBUF flag must have been passed to SDL_SetVideoMode() when
* setting the video mode for this function to perform hardware flipping.
* This function returns 0 if successful, or -1 if there was an error.
*/
extern DECLSPEC int SDLCALL SDL_Flip(SDL_Surface *screen);
/*
* Set the gamma correction for each of the color channels.
* The gamma values range (approximately) between 0.1 and 10.0
*
* If this function isn't supported directly by the hardware, it will
* be emulated using gamma ramps, if available. If successful, this
* function returns 0, otherwise it returns -1.
*/
extern DECLSPEC int SDLCALL SDL_SetGamma(float red, float green, float blue);
/*
* Set the gamma translation table for the red, green, and blue channels
* of the video hardware. Each table is an array of 256 16-bit quantities,
* representing a mapping between the input and output for that channel.
* The input is the index into the array, and the output is the 16-bit
* gamma value at that index, scaled to the output color precision.
*
* You may pass NULL for any of the channels to leave it unchanged.
* If the call succeeds, it will return 0. If the display driver or
* hardware does not support gamma translation, or otherwise fails,
* this function will return -1.
*/
extern DECLSPEC int SDLCALL SDL_SetGammaRamp(const Uint16 *red, const Uint16 *green, const Uint16 *blue);
/*
* Retrieve the current values of the gamma translation tables.
*
* You must pass in valid pointers to arrays of 256 16-bit quantities.
* Any of the pointers may be NULL to ignore that channel.
* If the call succeeds, it will return 0. If the display driver or
* hardware does not support gamma translation, or otherwise fails,
* this function will return -1.
*/
extern DECLSPEC int SDLCALL SDL_GetGammaRamp(Uint16 *red, Uint16 *green, Uint16 *blue);
/*
* Sets a portion of the colormap for the given 8-bit surface. If 'surface'
* is not a palettized surface, this function does nothing, returning 0.
* If all of the colors were set as passed to SDL_SetColors(), it will
* return 1. If not all the color entries were set exactly as given,
* it will return 0, and you should look at the surface palette to
* determine the actual color palette.
*
* When 'surface' is the surface associated with the current display, the
* display colormap will be updated with the requested colors. If
* SDL_HWPALETTE was set in SDL_SetVideoMode() flags, SDL_SetColors()
* will always return 1, and the palette is guaranteed to be set the way
* you desire, even if the window colormap has to be warped or run under
* emulation.
*/
extern DECLSPEC int SDLCALL SDL_SetColors(SDL_Surface *surface,
SDL_Color *colors, int firstcolor, int ncolors);
/*
* Sets a portion of the colormap for a given 8-bit surface.
* 'flags' is one or both of:
* SDL_LOGPAL -- set logical palette, which controls how blits are mapped
* to/from the surface,
* SDL_PHYSPAL -- set physical palette, which controls how pixels look on
* the screen
* Only screens have physical palettes. Separate change of physical/logical
* palettes is only possible if the screen has SDL_HWPALETTE set.
*
* The return value is 1 if all colours could be set as requested, and 0
* otherwise.
*
* SDL_SetColors() is equivalent to calling this function with
* flags = (SDL_LOGPAL|SDL_PHYSPAL).
*/
extern DECLSPEC int SDLCALL SDL_SetPalette(SDL_Surface *surface, int flags,
SDL_Color *colors, int firstcolor,
int ncolors);
/*
* Maps an RGB triple to an opaque pixel value for a given pixel format
*/
extern DECLSPEC Uint32 SDLCALL SDL_MapRGB
(SDL_PixelFormat *format, Uint8 r, Uint8 g, Uint8 b);
/*
* Maps an RGBA quadruple to a pixel value for a given pixel format
*/
extern DECLSPEC Uint32 SDLCALL SDL_MapRGBA(SDL_PixelFormat *format,
Uint8 r, Uint8 g, Uint8 b, Uint8 a);
/*
* Maps a pixel value into the RGB components for a given pixel format
*/
extern DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel, SDL_PixelFormat *fmt,
Uint8 *r, Uint8 *g, Uint8 *b);
/*
* Maps a pixel value into the RGBA components for a given pixel format
*/
extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel, SDL_PixelFormat *fmt,
Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a);
/*
* Allocate and free an RGB surface (must be called after SDL_SetVideoMode)
* If the depth is 4 or 8 bits, an empty palette is allocated for the surface.
* If the depth is greater than 8 bits, the pixel format is set using the
* flags '[RGB]mask'.
* If the function runs out of memory, it will return NULL.
*
* The 'flags' tell what kind of surface to create.
* SDL_SWSURFACE means that the surface should be created in system memory.
* SDL_HWSURFACE means that the surface should be created in video memory,
* with the same format as the display surface. This is useful for surfaces
* that will not change much, to take advantage of hardware acceleration
* when being blitted to the display surface.
* SDL_ASYNCBLIT means that SDL will try to perform asynchronous blits with
* this surface, but you must always lock it before accessing the pixels.
* SDL will wait for current blits to finish before returning from the lock.
* SDL_SRCCOLORKEY indicates that the surface will be used for colorkey blits.
* If the hardware supports acceleration of colorkey blits between
* two surfaces in video memory, SDL will try to place the surface in
* video memory. If this isn't possible or if there is no hardware
* acceleration available, the surface will be placed in system memory.
* SDL_SRCALPHA means that the surface will be used for alpha blits and
* if the hardware supports hardware acceleration of alpha blits between
* two surfaces in video memory, to place the surface in video memory
* if possible, otherwise it will be placed in system memory.
* If the surface is created in video memory, blits will be _much_ faster,
* but the surface format must be identical to the video surface format,
* and the only way to access the pixels member of the surface is to use
* the SDL_LockSurface() and SDL_UnlockSurface() calls.
* If the requested surface actually resides in video memory, SDL_HWSURFACE
* will be set in the flags member of the returned surface. If for some
* reason the surface could not be placed in video memory, it will not have
* the SDL_HWSURFACE flag set, and will be created in system memory instead.
*/
#define SDL_AllocSurface SDL_CreateRGBSurface
extern DECLSPEC SDL_Surface * SDLCALL SDL_CreateRGBSurface
(Uint32 flags, int width, int height, int depth,
Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
extern DECLSPEC SDL_Surface * SDLCALL SDL_CreateRGBSurfaceFrom(void *pixels,
int width, int height, int depth, int pitch,
Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
extern DECLSPEC void SDLCALL SDL_FreeSurface(SDL_Surface *surface);
/*
* SDL_LockSurface() sets up a surface for directly accessing the pixels.
* Between calls to SDL_LockSurface()/SDL_UnlockSurface(), you can write
* to and read from 'surface->pixels', using the pixel format stored in
* 'surface->format'. Once you are done accessing the surface, you should
* use SDL_UnlockSurface() to release it.
*
* Not all surfaces require locking. If SDL_MUSTLOCK(surface) evaluates
* to 0, then you can read and write to the surface at any time, and the
* pixel format of the surface will not change. In particular, if the
* SDL_HWSURFACE flag is not given when calling SDL_SetVideoMode(), you
* will not need to lock the display surface before accessing it.
*
* No operating system or library calls should be made between lock/unlock
* pairs, as critical system locks may be held during this time.
*
* SDL_LockSurface() returns 0, or -1 if the surface couldn't be locked.
*/
extern DECLSPEC int SDLCALL SDL_LockSurface(SDL_Surface *surface);
extern DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface *surface);
/*
* Load a surface from a seekable SDL data source (memory or file.)
* If 'freesrc' is non-zero, the source will be closed after being read.
* Returns the new surface, or NULL if there was an error.
* The new surface should be freed with SDL_FreeSurface().
*/
extern DECLSPEC SDL_Surface * SDLCALL SDL_LoadBMP_RW(SDL_RWops *src, int freesrc);
/* Convenience macro -- load a surface from a file */
#define SDL_LoadBMP(file) SDL_LoadBMP_RW(SDL_RWFromFile(file, "rb"), 1)
/*
* Save a surface to a seekable SDL data source (memory or file.)
* If 'freedst' is non-zero, the source will be closed after being written.
* Returns 0 if successful or -1 if there was an error.
*/
extern DECLSPEC int SDLCALL SDL_SaveBMP_RW
(SDL_Surface *surface, SDL_RWops *dst, int freedst);
/* Convenience macro -- save a surface to a file */
#define SDL_SaveBMP(surface, file) \
SDL_SaveBMP_RW(surface, SDL_RWFromFile(file, "wb"), 1)
/*
* Sets the color key (transparent pixel) in a blittable surface.
* If 'flag' is SDL_SRCCOLORKEY (optionally OR'd with SDL_RLEACCEL),
* 'key' will be the transparent pixel in the source image of a blit.
* SDL_RLEACCEL requests RLE acceleration for the surface if present,
* and removes RLE acceleration if absent.
* If 'flag' is 0, this function clears any current color key.
* This function returns 0, or -1 if there was an error.
*/
extern DECLSPEC int SDLCALL SDL_SetColorKey
(SDL_Surface *surface, Uint32 flag, Uint32 key);
/*
* This function sets the alpha value for the entire surface, as opposed to
* using the alpha component of each pixel. This value measures the range
* of transparency of the surface, 0 being completely transparent to 255
* being completely opaque. An 'alpha' value of 255 causes blits to be
* opaque, the source pixels copied to the destination (the default). Note
* that per-surface alpha can be combined with colorkey transparency.
*
* If 'flag' is 0, alpha blending is disabled for the surface.
* If 'flag' is SDL_SRCALPHA, alpha blending is enabled for the surface.
* OR:ing the flag with SDL_RLEACCEL requests RLE acceleration for the
* surface; if SDL_RLEACCEL is not specified, the RLE accel will be removed.
*
* The 'alpha' parameter is ignored for surfaces that have an alpha channel.
*/
extern DECLSPEC int SDLCALL SDL_SetAlpha(SDL_Surface *surface, Uint32 flag, Uint8 alpha);
/*
* Sets the clipping rectangle for the destination surface in a blit.
*
* If the clip rectangle is NULL, clipping will be disabled.
* If the clip rectangle doesn't intersect the surface, the function will
* return SDL_FALSE and blits will be completely clipped. Otherwise the
* function returns SDL_TRUE and blits to the surface will be clipped to
* the intersection of the surface area and the clipping rectangle.
*
* Note that blits are automatically clipped to the edges of the source
* and destination surfaces.
*/
extern DECLSPEC SDL_bool SDLCALL SDL_SetClipRect(SDL_Surface *surface, const SDL_Rect *rect);
/*
* Gets the clipping rectangle for the destination surface in a blit.
* 'rect' must be a pointer to a valid rectangle which will be filled
* with the correct values.
*/
extern DECLSPEC void SDLCALL SDL_GetClipRect(SDL_Surface *surface, SDL_Rect *rect);
/*
* Creates a new surface of the specified format, and then copies and maps
* the given surface to it so the blit of the converted surface will be as
* fast as possible. If this function fails, it returns NULL.
*
* The 'flags' parameter is passed to SDL_CreateRGBSurface() and has those
* semantics. You can also pass SDL_RLEACCEL in the flags parameter and
* SDL will try to RLE accelerate colorkey and alpha blits in the resulting
* surface.
*
* This function is used internally by SDL_DisplayFormat().
*/
extern DECLSPEC SDL_Surface * SDLCALL SDL_ConvertSurface
(SDL_Surface *src, SDL_PixelFormat *fmt, Uint32 flags);
/*
* This performs a fast blit from the source surface to the destination
* surface. It assumes that the source and destination rectangles are
* the same size. If either 'srcrect' or 'dstrect' are NULL, the entire
* surface (src or dst) is copied. The final blit rectangles are saved
* in 'srcrect' and 'dstrect' after all clipping is performed.
* If the blit is successful, it returns 0, otherwise it returns -1.
*
* The blit function should not be called on a locked surface.
*
* The blit semantics for surfaces with and without alpha and colorkey
* are defined as follows:
*
* RGBA->RGB:
* SDL_SRCALPHA set:
* alpha-blend (using alpha-channel).
* SDL_SRCCOLORKEY ignored.
* SDL_SRCALPHA not set:
* copy RGB.
* if SDL_SRCCOLORKEY set, only copy the pixels matching the
* RGB values of the source colour key, ignoring alpha in the
* comparison.
*
* RGB->RGBA:
* SDL_SRCALPHA set:
* alpha-blend (using the source per-surface alpha value);
* set destination alpha to opaque.
* SDL_SRCALPHA not set:
* copy RGB, set destination alpha to source per-surface alpha value.
* both:
* if SDL_SRCCOLORKEY set, only copy the pixels matching the
* source colour key.
*
* RGBA->RGBA:
* SDL_SRCALPHA set:
* alpha-blend (using the source alpha channel) the RGB values;
* leave destination alpha untouched. [Note: is this correct?]
* SDL_SRCCOLORKEY ignored.
* SDL_SRCALPHA not set:
* copy all of RGBA to the destination.
* if SDL_SRCCOLORKEY set, only copy the pixels matching the
* RGB values of the source colour key, ignoring alpha in the
* comparison.
*
* RGB->RGB:
* SDL_SRCALPHA set:
* alpha-blend (using the source per-surface alpha value).
* SDL_SRCALPHA not set:
* copy RGB.
* both:
* if SDL_SRCCOLORKEY set, only copy the pixels matching the
* source colour key.
*
* If either of the surfaces were in video memory, and the blit returns -2,
* the video memory was lost, so it should be reloaded with artwork and
* re-blitted:
while ( SDL_BlitSurface(image, imgrect, screen, dstrect) == -2 ) {
while ( SDL_LockSurface(image) < 0 )
Sleep(10);
-- Write image pixels to image->pixels --
SDL_UnlockSurface(image);
}
* This happens under DirectX 5.0 when the system switches away from your
* fullscreen application. The lock will also fail until you have access
* to the video memory again.
*/
/* You should call SDL_BlitSurface() unless you know exactly how SDL
blitting works internally and how to use the other blit functions.
*/
#define SDL_BlitSurface SDL_UpperBlit
/* This is the public blit function, SDL_BlitSurface(), and it performs
rectangle validation and clipping before passing it to SDL_LowerBlit()
*/
extern DECLSPEC int SDLCALL SDL_UpperBlit
(SDL_Surface *src, SDL_Rect *srcrect,
SDL_Surface *dst, SDL_Rect *dstrect);
/* This is a semi-private blit function and it performs low-level surface
blitting only.
*/
extern DECLSPEC int SDLCALL SDL_LowerBlit
(SDL_Surface *src, SDL_Rect *srcrect,
SDL_Surface *dst, SDL_Rect *dstrect);
/*
* This function performs a fast fill of the given rectangle with 'color'
* The given rectangle is clipped to the destination surface clip area
* and the final fill rectangle is saved in the passed in pointer.
* If 'dstrect' is NULL, the whole surface will be filled with 'color'
* The color should be a pixel of the format used by the surface, and
* can be generated by the SDL_MapRGB() function.
* This function returns 0 on success, or -1 on error.
*/
extern DECLSPEC int SDLCALL SDL_FillRect
(SDL_Surface *dst, SDL_Rect *dstrect, Uint32 color);
/*
* This function takes a surface and copies it to a new surface of the
* pixel format and colors of the video framebuffer, suitable for fast
* blitting onto the display surface. It calls SDL_ConvertSurface()
*
* If you want to take advantage of hardware colorkey or alpha blit
* acceleration, you should set the colorkey and alpha value before
* calling this function.
*
* If the conversion fails or runs out of memory, it returns NULL
*/
extern DECLSPEC SDL_Surface * SDLCALL SDL_DisplayFormat(SDL_Surface *surface);
/*
* This function takes a surface and copies it to a new surface of the
* pixel format and colors of the video framebuffer (if possible),
* suitable for fast alpha blitting onto the display surface.
* The new surface will always have an alpha channel.
*
* If you want to take advantage of hardware colorkey or alpha blit
* acceleration, you should set the colorkey and alpha value before
* calling this function.
*
* If the conversion fails or runs out of memory, it returns NULL
*/
extern DECLSPEC SDL_Surface * SDLCALL SDL_DisplayFormatAlpha(SDL_Surface *surface);
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* YUV video surface overlay functions */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* This function creates a video output overlay
Calling the returned surface an overlay is something of a misnomer because
the contents of the display surface underneath the area where the overlay
is shown is undefined - it may be overwritten with the converted YUV data.
*/
extern DECLSPEC SDL_Overlay * SDLCALL SDL_CreateYUVOverlay(int width, int height,
Uint32 format, SDL_Surface *display);
/* Lock an overlay for direct access, and unlock it when you are done */
extern DECLSPEC int SDLCALL SDL_LockYUVOverlay(SDL_Overlay *overlay);
extern DECLSPEC void SDLCALL SDL_UnlockYUVOverlay(SDL_Overlay *overlay);
/* Blit a video overlay to the display surface.
The contents of the video surface underneath the blit destination are
not defined.
The width and height of the destination rectangle may be different from
that of the overlay, but currently only 2x scaling is supported.
*/
extern DECLSPEC int SDLCALL SDL_DisplayYUVOverlay(SDL_Overlay *overlay, SDL_Rect *dstrect);
/* Free a video overlay */
extern DECLSPEC void SDLCALL SDL_FreeYUVOverlay(SDL_Overlay *overlay);
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* OpenGL support functions. */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
* Dynamically load an OpenGL library, or the default one if path is NULL
*
* If you do this, you need to retrieve all of the GL functions used in
* your program from the dynamic library using SDL_GL_GetProcAddress().
*/
extern DECLSPEC int SDLCALL SDL_GL_LoadLibrary(const char *path);
/*
* Get the address of a GL function
*/
extern DECLSPEC void * SDLCALL SDL_GL_GetProcAddress(const char* proc);
/*
* Set an attribute of the OpenGL subsystem before intialization.
*/
extern DECLSPEC int SDLCALL SDL_GL_SetAttribute(SDL_GLattr attr, int value);
/*
* Get an attribute of the OpenGL subsystem from the windowing
* interface, such as glX. This is of course different from getting
* the values from SDL's internal OpenGL subsystem, which only
* stores the values you request before initialization.
*
* Developers should track the values they pass into SDL_GL_SetAttribute
* themselves if they want to retrieve these values.
*/
extern DECLSPEC int SDLCALL SDL_GL_GetAttribute(SDL_GLattr attr, int* value);
/*
* Swap the OpenGL buffers, if double-buffering is supported.
*/
extern DECLSPEC void SDLCALL SDL_GL_SwapBuffers(void);
/*
* Internal functions that should not be called unless you have read
* and understood the source code for these functions.
*/
extern DECLSPEC void SDLCALL SDL_GL_UpdateRects(int numrects, SDL_Rect* rects);
extern DECLSPEC void SDLCALL SDL_GL_Lock(void);
extern DECLSPEC void SDLCALL SDL_GL_Unlock(void);
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* These functions allow interaction with the window manager, if any. */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
* Sets/Gets the title and icon text of the display window (UTF-8 encoded)
*/
extern DECLSPEC void SDLCALL SDL_WM_SetCaption(const char *title, const char *icon);
extern DECLSPEC void SDLCALL SDL_WM_GetCaption(char **title, char **icon);
/*
* Sets the icon for the display window.
* This function must be called before the first call to SDL_SetVideoMode().
* It takes an icon surface, and a mask in MSB format.
* If 'mask' is NULL, the entire icon surface will be used as the icon.
*/
extern DECLSPEC void SDLCALL SDL_WM_SetIcon(SDL_Surface *icon, Uint8 *mask);
/*
* This function iconifies the window, and returns 1 if it succeeded.
* If the function succeeds, it generates an SDL_APPACTIVE loss event.
* This function is a noop and returns 0 in non-windowed environments.
*/
extern DECLSPEC int SDLCALL SDL_WM_IconifyWindow(void);
/*
* Toggle fullscreen mode without changing the contents of the screen.
* If the display surface does not require locking before accessing
* the pixel information, then the memory pointers will not change.
*
* If this function was able to toggle fullscreen mode (change from
* running in a window to fullscreen, or vice-versa), it will return 1.
* If it is not implemented, or fails, it returns 0.
*
* The next call to SDL_SetVideoMode() will set the mode fullscreen
* attribute based on the flags parameter - if SDL_FULLSCREEN is not
* set, then the display will be windowed by default where supported.
*
* This is currently only implemented in the X11 video driver.
*/
extern DECLSPEC int SDLCALL SDL_WM_ToggleFullScreen(SDL_Surface *surface);
/*
* This function allows you to set and query the input grab state of
* the application. It returns the new input grab state.
*/
typedef enum {
SDL_GRAB_QUERY = -1,
SDL_GRAB_OFF = 0,
SDL_GRAB_ON = 1,
SDL_GRAB_FULLSCREEN /* Used internally */
} SDL_GrabMode;
/*
* Grabbing means that the mouse is confined to the application window,
* and nearly all keyboard input is passed directly to the application,
* and not interpreted by a window manager, if any.
*/
extern DECLSPEC SDL_GrabMode SDLCALL SDL_WM_GrabInput(SDL_GrabMode mode);
/* Not in public API at the moment - do not use! */
extern DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface *src, SDL_Rect *srcrect,
SDL_Surface *dst, SDL_Rect *dstrect);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif /* _SDL_video_h */

View File

@ -1,150 +0,0 @@
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2004 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Sam Lantinga
slouken@libsdl.org
*/
/* This file sets things up for C dynamic library function definitions,
static inlined functions, and structures aligned at 4-byte alignment.
If you don't like ugly C preprocessor code, don't look at this file. :)
*/
/* This shouldn't be nested -- included it around code only. */
#ifdef _begin_code_h
#error Nested inclusion of begin_code.h
#endif
#define _begin_code_h
/* Some compilers use a special export keyword */
#ifndef DECLSPEC
# if defined(__BEOS__)
# if defined(__GNUC__)
# define DECLSPEC __declspec(dllexport)
# else
# define DECLSPEC __declspec(export)
# endif
# elif defined(__WIN32__)
# ifdef __BORLANDC__
# ifdef BUILD_SDL
# define DECLSPEC
# else
# define DECLSPEC __declspec(dllimport)
# endif
# else
# define DECLSPEC __declspec(dllexport)
# endif
# elif defined(__OS2__)
# ifdef __WATCOMC__
# ifdef BUILD_SDL
# define DECLSPEC __declspec(dllexport)
# else
# define DECLSPEC
# endif
# else
# define DECLSPEC
# endif
# else
# if defined(__GNUC__) && __GNUC__ >= 4
# define DECLSPEC __attribute__ ((visibility("default")))
# else
# define DECLSPEC
# endif
# endif
#endif
/* By default SDL uses the C calling convention */
#ifndef SDLCALL
#if defined(__WIN32__) && !defined(__GNUC__)
#define SDLCALL __cdecl
#else
#ifdef __OS2__
/* But on OS/2, we use the _System calling convention */
/* to be compatible with every compiler */
#define SDLCALL _System
#else
#define SDLCALL
#endif
#endif
#endif /* SDLCALL */
/* Removed DECLSPEC on Symbian OS because SDL cannot be a DLL in EPOC */
#ifdef __SYMBIAN32__
#undef DECLSPEC
#define DECLSPEC
#endif /* __SYMBIAN32__ */
/* Force structure packing at 4 byte alignment.
This is necessary if the header is included in code which has structure
packing set to an alternate value, say for loading structures from disk.
The packing is reset to the previous value in close_code.h
*/
#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__)
#ifdef _MSC_VER
#pragma warning(disable: 4103)
#endif
#ifdef __BORLANDC__
#pragma nopackwarning
#endif
#pragma pack(push,4)
#elif (defined(__MWERKS__) && defined(__MACOS__))
#pragma options align=mac68k4byte
#pragma enumsalwaysint on
#endif /* Compiler needs structure packing set */
/* Set up compiler-specific options for inlining functions */
#ifndef SDL_INLINE_OKAY
#ifdef __GNUC__
#define SDL_INLINE_OKAY
#else
/* Add any special compiler-specific cases here */
#if defined(_MSC_VER) || defined(__BORLANDC__) || \
defined(__DMC__) || defined(__SC__) || \
defined(__WATCOMC__) || defined(__LCC__) || \
defined(__DECC)
#ifndef __inline__
#define __inline__ __inline
#endif
#define SDL_INLINE_OKAY
#else
#if !defined(__MRC__) && !defined(_SGI_SOURCE)
#define __inline__ inline
#define SDL_INLINE_OKAY
#endif /* Not a funky compiler */
#endif /* Visual C++ */
#endif /* GNU C */
#endif /* SDL_INLINE_OKAY */
/* If inlining isn't supported, remove "__inline__", turning static
inlined functions into static functions (resulting in code bloat
in all files which include the offending header files)
*/
#ifndef SDL_INLINE_OKAY
#define __inline__
#endif
/* Apparently this is needed by several Windows compilers */
#if !defined(__MACH__)
#ifndef NULL
#ifdef __cplusplus
#define NULL 0
#else
#define NULL ((void *)0)
#endif
#endif /* NULL */
#endif /* ! Mac OS X - breaks precompiled headers */

View File

@ -1,41 +0,0 @@
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2004 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Sam Lantinga
slouken@libsdl.org
*/
/* This file reverses the effects of begin_code.h and should be included
after you finish any function and structure declarations in your headers
*/
#undef _begin_code_h
/* Reset structure packing at previous byte alignment */
#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__WATCOMC__) || defined(__BORLANDC__)
#ifdef __BORLANDC__
#pragma nopackwarning
#endif
#if (defined(__MWERKS__) && defined(__MACOS__))
#pragma options align=reset
#pragma enumsalwaysint reset
#else
#pragma pack(pop)
#endif
#endif /* Compiler needs structure packing set */

View File

@ -0,0 +1,55 @@
// Copyright (C) 2002-2007 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __E_DRIVER_TYPES_H_INCLUDED__
#define __E_DRIVER_TYPES_H_INCLUDED__
namespace irr
{
namespace video
{
//! An enum for all types of drivers the Irrlicht Engine supports.
enum E_DRIVER_TYPE
{
//! Null device, useful for applications to run the engine without visualisation.
//! The null device is able to load textures, but does not render and display
//! any graphics.
EDT_NULL,
//! The Irrlicht Engine Software renderer, runs on all platforms,
//! with every hardware. It should only be used for 2d graphics,
//! but it can also perform some primitive 3d functions. These 3d drawing
//! functions are quite fast, but very inaccurate, and don't even support
//! clipping in 3D mode.
EDT_SOFTWARE,
//! The Burning's Software Renderer, an alternative software renderer for Irrlicht.
//! Basically it can be described as the Irrlicht Software renderer on steroids. It rasterizes
//! 3D geometry perfectly: It is able to perform correct 3d clipping, perspective
//! correct texture mapping, perspective correct color mapping, and renders
//! sub pixel correct, sub texel correct primitives. In addition, it does
//! bilinear texel filtering and supports more materials than the EDT_SOFTWARE driver.
//! This renderer has been written entirely by Thomas Alten, thanks a lot for this huge
//! contribution.
EDT_BURNINGSVIDEO,
//! Direct3D 8 device, only available on Win32 platforms including Win95, Win98, WinNT,
//! Win2K, WinXP. Performs hardware accelerated rendering of 3D and 2D primitives.
EDT_DIRECT3D8,
//! Direct3D 9 device, only available on Win32 platforms including Win95, Win98, WinNT,
//! Win2K, WinXP. Performs hardware accelerated rendering of 3D and 2D primitives.
EDT_DIRECT3D9,
//! OpenGL device, available on all Win32 platforms and on Linux.
//! Performs hardware accelerated rendering of 3D and 2D primitives.
EDT_OPENGL
};
} // end namespace video
} // end namespace irr
#endif

View File

@ -0,0 +1,119 @@
// Copyright (C) 2002-2007 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __E_GUI_ELEMENT_TYPES_H_INCLUDED__
#define __E_GUI_ELEMENT_TYPES_H_INCLUDED__
namespace irr
{
namespace gui
{
//! List of all basic Irrlicht GUI elements.
/** An IGUIElement returns this when calling IGUIElement::getType(); */
enum EGUI_ELEMENT_TYPE
{
//! A button (IGUIButton)
EGUIET_BUTTON = 0,
//! A check box (IGUICheckBox)
EGUIET_CHECK_BOX,
//! A combo box (IGUIComboBox)
EGUIET_COMBO_BOX,
//! A context menu (IGUIContextMenu)
EGUIET_CONTEXT_MENU,
//! A menu (IGUIMenu)
EGUIET_MENU,
//! An edit box (IGUIEditBox)
EGUIET_EDIT_BOX,
//! A file open dialog (IGUIFileOpenDialog)
EGUIET_FILE_OPEN_DIALOG,
//! A color select open dialog (IGUIColorSelectDialog)
EGUIET_COLOR_SELECT_DIALOG,
//! A in/out fader (IGUIInOutFader)
EGUIET_IN_OUT_FADER,
//! An image (IGUIImage)
EGUIET_IMAGE,
//! A list box (IGUIListBox)
EGUIET_LIST_BOX,
//! A mesh viewer (IGUIMeshViewer)
EGUIET_MESH_VIEWER,
//! A message box (IGUIWindow)
EGUIET_MESSAGE_BOX,
//! A modal screen
EGUIET_MODAL_SCREEN,
//! A scroll bar (IGUIScrollBar)
EGUIET_SCROLL_BAR,
//! A static text (IGUIStaticText)
EGUIET_STATIC_TEXT,
//! A tab (IGUITab)
EGUIET_TAB,
//! A tab control
EGUIET_TAB_CONTROL,
//! A tool bar (IGUIToolBar)
EGUIET_TOOL_BAR,
//! A window
EGUIET_WINDOW,
//! Not an element, amount of elements in there
EGUIET_COUNT,
//! Unknown type.
EGUIET_ELEMENT,
//! This enum is never used, it only forces the compiler to
//! compile these enumeration values to 32 bit.
EGUIET_FORCE_32_BIT = 0x7fffffff
};
//! Names for built-in element types
const c8* const GUIElementTypeNames[] =
{
"button",
"checkBox",
"comboBox",
"contextMenu",
"menu",
"editBox",
"fileOpenDialog",
"colorSelectDialog",
"inOutFader",
"image",
"listBox",
"meshViewer",
"messageBox",
"modalScreen",
"scrollBar",
"staticText",
"tab",
"tabControl",
"toolBar",
"window",
0
};
} // end namespace gui
} // end namespace irr
#endif

View File

@ -0,0 +1,52 @@
// Copyright (C) 2002-2007 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __E_SCENE_NODE_ANIMATOR_TYPES_H_INCLUDED__
#define __E_SCENE_NODE_ANIMATOR_TYPES_H_INCLUDED__
namespace irr
{
namespace scene
{
//! An enumeration for all types of built-in scene node animators
enum ESCENE_NODE_ANIMATOR_TYPE
{
//! Fly circle scene node animator
ESNAT_FLY_CIRCLE = 0,
//! Fly straight scene node animator
ESNAT_FLY_STRAIGHT,
//! Follow spline scene node animator
ESNAT_FOLLOW_SPLINE,
//! Rotation scene node animator
ESNAT_ROTATION,
//! Texture scene node animator
ESNAT_TEXTURE,
//! Deletion scene node animator
ESNAT_DELETION,
//! Collision respose scene node animator
ESNAT_COLLISION_RESPONSE,
//! Amount of build in scene node animators
ESNAT_COUNT,
//! Unknown scene node animator
ESNAT_UNKNOWN,
//! This enum is never used, it only forces the compiler to
//! compile these enumeration values to 32 bit.
ESNAT_FORCE_32_BIT = 0x7fffffff
};
} // end namespace scene
} // end namespace irr
#endif

View File

@ -0,0 +1,130 @@
// Copyright (C) 2002-2007 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __E_SCENE_NODE_TYPES_H_INCLUDED__
#define __E_SCENE_NODE_TYPES_H_INCLUDED__
namespace irr
{
namespace scene
{
//! An enumeration for all types of built-in scene nodes
enum ESCENE_NODE_TYPE
{
//! simple cube scene node
ESNT_CUBE = 0,
//! Sphere scene node
ESNT_SPHERE,
//! Text Scene Node
ESNT_TEXT,
//! Water Surface Scene Node
ESNT_WATER_SURFACE,
//! Terrain Scene Node
ESNT_TERRAIN,
//! Sky Box Scene Node
ESNT_SKY_BOX,
//! Shadow Volume Scene Node
ESNT_SHADOW_VOLUME,
//! OctTree Scene Node
ESNT_OCT_TREE,
//! Mesh Scene Node
ESNT_MESH,
//! Light Scene Node
ESNT_LIGHT,
//! Empty Scene Node
ESNT_EMPTY,
//! Dummy Transformation Scene Node
ESNT_DUMMY_TRANSFORMATION,
//! Camera Scene Node
ESNT_CAMERA,
//! Maya Camera Scene Node
ESNT_CAMERA_MAYA,
//! First Person Shooter style Camera
ESNT_CAMERA_FPS,
//! Billboard Scene Node
ESNT_BILLBOARD,
//! Animated Mesh Scene Node
ESNT_ANIMATED_MESH,
//! Particle System Scene Node
ESNT_PARTICLE_SYSTEM,
//! Quake3 Model Scene Node ( has tag to link to )
ESNT_MD3_SCENE_NODE,
//! Amount of build in Scene Nodes
ESNT_COUNT,
//! Unknown scene node
ESNT_UNKNOWN,
//! This enum is never used, it only forces the compiler to
//! compile these enumeration values to 32 bit.
ESNT_FORCE_32_BIT = 0x7fffffff
};
//! An enumeration for all types of automatic culling for built-in scene nodes
enum E_CULLING_TYPE
{
EAC_OFF = 0,
EAC_BOX,
EAC_FRUSTUM_BOX,
EAC_FRUSTUM_SPHERE
};
//! Names for culling type
const c8* const AutomaticCullingNames[] =
{
"false",
"box", // camera box against node box
"frustum_box", // camera frustum against node box
"frustum_sphere", // camera frustum against node sphere
0
};
//! An enumeration for all types of debug data for built-in scene nodes (flags)
enum E_DEBUG_SCENE_TYPE
{
//! No Debug Data ( Default )
EDS_OFF = 0,
//! Show Bounding Boxes of SceneNode
EDS_BBOX = 1,
//! Show Vertex Normals
EDS_NORMALS = 2,
//! Shows Skeleton/Tags
EDS_SKELETON = 4,
//! Overlays Mesh Wireframe
EDS_MESH_WIRE_OVERLAY = 8,
//! Temporary use transparency Material Type
EDS_HALF_TRANSPARENCY = 16,
//! Show Bounding Boxes of all MeshBuffers
EDS_BBOX_BUFFERS = 32,
EDS_FULL = EDS_BBOX | EDS_NORMALS | EDS_SKELETON | EDS_MESH_WIRE_OVERLAY
};
} // end namespace scene
} // end namespace irr
#endif

View File

@ -0,0 +1,35 @@
// Copyright (C) 2002-2006 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __E_TERRAIN_ELEMENTS_H__
#define __E_TERRAIN_ELEMENTS_H__
namespace irr
{
namespace scene
{
//! enumeration for patch sizes specifying the size of patches in the TerrainSceneNode
enum E_TERRAIN_PATCH_SIZE
{
//! patch size of 9, at most, use 4 levels of detail with this patch size.
ETPS_9 = 9,
//! patch size of 17, at most, use 5 levels of detail with this patch size.
ETPS_17 = 17,
//! patch size of 33, at most, use 6 levels of detail with this patch size.
ETPS_33 = 33,
//! patch size of 65, at most, use 7 levels of detail with this patch size.
ETPS_65 = 65,
//! patch size of 129, at most, use 8 levels of detail with this patch size.
ETPS_129 = 129
};
} // end namespace scene
} // end namespace irr
#endif

View File

@ -0,0 +1,115 @@
// Copyright (C) 2002-2007 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_ANIMATED_MESH_H_INCLUDED__
#define __I_ANIMATED_MESH_H_INCLUDED__
#include "IUnknown.h"
#include "IMesh.h"
#include "matrix4.h"
namespace irr
{
namespace scene
{
enum E_ANIMATED_MESH_TYPE
{
//! Unknown animated mesh type.
EAMT_UNKNOWN = 0,
//! Quake 2 MD2 model file
EAMT_MD2,
//! Quake 3 MD3 model file
EAMT_MD3,
//! Milkshape 3d skeletal animation file
EAMT_MS3D,
//! Maya .obj not animated model
EAMT_OBJ,
//! Quake 3 .bsp Map, not animated
EAMT_BSP,
//! 3D Studio .3ds file
EAMT_3DS,
//! Microsoft Direct3D .x-file. Can contain static and skeletal animated
//! skinned meshes. This is the standard and best supported
//! format of the Irrlicht Engine.
EAMT_X,
//! My3D Mesh, the file format by Zhuck Dimitry
EAMT_MY3D,
//! Pulsar LMTools (.lmts) file. The Irrlicht loader for this was written by
//! Jonas Petersen
EAMT_LMTS,
//! Cartography Shop .csm file. The loader for this was created by Saurav Mohapatra.
EAMT_CSM,
//! .oct file for Paul Nette's FSRad or from Murphy McCauley's Blender .oct exporter.
//! The oct file format contains 3D geometry and lightmaps and can
//! be loaded directly by Irrlicht
EAMT_OCT,
//! Blitz Basic .b3d file, the file format by Mark Sibly
EAMT_B3D
};
//! Interface for an animated mesh.
/** There are already simple implementations of this interface available so
you don't have to implement this interface on your own if you need to:
You might want to use irr::scene::SAnimatedMesh, irr::scene::SMesh,
irr::scene::SMeshBuffer etc. */
class IAnimatedMesh : public virtual IUnknown
{
public:
//! destructor
virtual ~IAnimatedMesh() {};
//! Gets the frame count of the animated mesh.
/** \return Returns the amount of frames. If the amount is 1, it is a
static, non animated mesh. */
virtual s32 getFrameCount() = 0;
//! Returns the IMesh interface for a frame.
/** \param frame: Frame number as zero based index. The maximum frame number is
getFrameCount() - 1;
\param detailLevel: Level of detail. 0 is the lowest,
255 the highest level of detail. Most meshes will ignore the detail level.
\param startFrameLoop: Because some animated meshes (.MD2) are blended between 2
static frames, and maybe animated in a loop, the startFrameLoop and the endFrameLoop
have to be defined, to prevent the animation to be blended between frames which are
outside of this loop.
If startFrameLoop and endFrameLoop are both -1, they are ignored.
\param endFrameLoop: see startFrameLoop.
\return Returns the animated mesh based on a detail level. */
virtual IMesh* getMesh(s32 frame, s32 detailLevel=255, s32 startFrameLoop=-1, s32 endFrameLoop=-1) = 0;
//! Returns an axis aligned bounding box of the mesh.
/** \return A bounding box of this mesh is returned. */
virtual const core::aabbox3d<f32>& getBoundingBox() const = 0;
//! Returns the type of the animated mesh.
/** In most cases it is not neccessary to use this method.
This is useful for making a save downcast, for example
if getMeshType() returns EAMT_MD2, its save to cast the
IAnimatedMesh to IAnimatedMeshMD2.
\returns Type of the mesh. */
virtual E_ANIMATED_MESH_TYPE getMeshType() const
{
return EAMT_UNKNOWN;
}
};
} // end namespace scene
} // end namespace irr
#endif

View File

@ -0,0 +1,96 @@
// Copyright (C) 2002-2006 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_ANIMATED_MESH_B3D_H_INCLUDED__
#define __I_ANIMATED_MESH_B3D_H_INCLUDED__
#include "ISceneNode.h"
#include "IAnimatedMesh.h"
namespace irr
{
namespace scene
{
//! Interface for using some special functions of B3d meshes
/** Please note that the B3d Mesh's frame numbers are scaled by 100 */
class IAnimatedMeshB3d : public IAnimatedMesh
{
public:
//! Returns a pointer to a transformation matrix of a part of the
//! mesh based on a frame time. This is used for being able to attach
//! objects to parts of animated meshes. For example a weapon to an animated
//! hand.
//! \param jointNumber: Zero based index of joint. The last joint has the number
//! IAnimatedMeshB3d::getJointCount()-1;
//! \param frame: Frame of the animation.
//! \return Returns a pointer to the matrix of the mesh part or
//! null if an error occured.
virtual core::matrix4* getMatrixOfJoint(s32 jointNumber, s32 frame) = 0;
//! Returns a pointer to a local matrix of a Joint, can be used to control the animation
virtual core::matrix4* getLocalMatrixOfJoint(s32 jointNumber) = 0;
//! Returns a pointer to a matrix of a part of the mesh unanimated
virtual core::matrix4* getMatrixOfJointUnanimated(s32 jointNumber) = 0;
//! Move this Joint's local matrix when animating
//! \param jointNumber: Zero based index of joint. The last joint has the number
//! IAnimatedMeshB3d::getJointCount()-1;
//! \param On: False= Leave joint's local matrix, True= Animate
//! (not used yet)
virtual void setJointAnimation(s32 jointNumber, bool On) = 0;
//! Gets joint count.
//! \return Returns amount of joints in the skeletal animated mesh.
virtual s32 getJointCount() const = 0;
//! Gets the name of a joint.
//! \param number: Zero based index of joint. The last joint has the number
//! IAnimatedMeshB3d::getJointCount()-1;
//! \return Returns name of joint and null if an error happened.
virtual const c8* getJointName(s32 number) const = 0;
//! Gets a joint number from its name
//! \param name: Name of the joint.
//! \return Returns the number of the joint or -1 if not found.
virtual s32 getJointNumber(const c8* name) const = 0;
//!Update Normals when Animating
//!False= Don't (default)
//!True= Update normals, slower
virtual void updateNormalsWhenAnimating(bool on) = 0;
//!Sets Interpolation Mode
//!0- Constant
//!1- Linear (default)
virtual void setInterpolationMode(s32 mode) = 0;
//!Want should happen on when animating
//!0-Nothing
//!1-Update nodes only
//!2-Update skin only
//!3-Update both nodes and skin (default)
virtual void setAnimateMode(s32 mode) = 0;
//!Convert all mesh buffers to use tangent vertices
virtual void convertToTangents() =0;
virtual void recoverJointsFromMesh(core::array<ISceneNode*> &JointChildSceneNodes)=0;
virtual void tranferJointsToMesh(core::array<ISceneNode*> &JointChildSceneNodes)=0;
virtual void createJoints(core::array<ISceneNode*> &JointChildSceneNodes, ISceneNode* AnimatedMeshSceneNode, ISceneManager* SceneManager)=0;
};
} // end namespace scene
} // end namespace irr
#endif

View File

@ -0,0 +1,78 @@
// Copyright (C) 2002-2007 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_ANIMATED_MESH_MD2_H_INCLUDED__
#define __I_ANIMATED_MESH_MD2_H_INCLUDED__
#include "IAnimatedMesh.h"
namespace irr
{
namespace scene
{
//! Types of standard md2 animations
enum EMD2_ANIMATION_TYPE
{
EMAT_STAND = 0,
EMAT_RUN,
EMAT_ATTACK,
EMAT_PAIN_A,
EMAT_PAIN_B,
EMAT_PAIN_C,
EMAT_JUMP,
EMAT_FLIP,
EMAT_SALUTE,
EMAT_FALLBACK,
EMAT_WAVE,
EMAT_POINT,
EMAT_CROUCH_STAND,
EMAT_CROUCH_WALK,
EMAT_CROUCH_ATTACK,
EMAT_CROUCH_PAIN,
EMAT_CROUCH_DEATH,
EMAT_DEATH_FALLBACK,
EMAT_DEATH_FALLFORWARD,
EMAT_DEATH_FALLBACKSLOW,
EMAT_BOOM,
//! Not an animation, but amount of animation types.
EMAT_COUNT
};
//! Interface for using some special functions of MD2 meshes
class IAnimatedMeshMD2 : public IAnimatedMesh
{
public:
//! Returns the beginframe, endframe and frames per second for a default MD2 animation type.
//! \param l: The EMD2_ANIMATION_TYPE to get the frames for.
//! \param outBegin: The returned beginning frame for animation type specified.
//! \param outEnd: The returned ending frame for the animation type specified.
//! \param outFPS: The number of frames per second, this animation should be played at.
virtual void getFrameLoop(EMD2_ANIMATION_TYPE l, s32& outBegin,
s32& outEnd, s32& outFPS) const = 0;
//! Returns the beginframe, endframe and frames per second for a special MD2 animation type.
//! \param name: Name of the animation.
//! \param outBegin: The returned beginning frame for animation type specified.
//! \param outEnd: The returned ending frame for the animation type specified.
//! \param outFPS: The number of frames per second, this animation should be played at.
virtual bool getFrameLoop(const c8* name,
s32& outBegin, s32& outEnd, s32& outFPS) const = 0;
//! Returns amount of md2 animations in this file.
virtual s32 getAnimationCount() const = 0;
//! Returns name of md2 animation.
//! \param nr: Zero based index of animation.
virtual const c8* getAnimationName(s32 nr) const = 0;
};
} // end namespace scene
} // end namespace irr
#endif

View File

@ -0,0 +1,269 @@
// Copyright (C) 2002-2007 Nikolaus Gebhardt / Thomas Alten
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_ANIMATED_MESH_MD3_H_INCLUDED__
#define __I_ANIMATED_MESH_MD3_H_INCLUDED__
#include "IAnimatedMesh.h"
#include "IQ3Shader.h"
#include "quaternion.h"
namespace irr
{
namespace scene
{
enum eMD3Models
{
EMD3_HEAD = 0,
EMD3_UPPER,
EMD3_LOWER,
EMD3_WEAPON,
EMD3_NUMMODELS
};
// Animation list
enum EMD3_ANIMATION_TYPE
{
// Animations for both lower and upper parts of the player
EMD3_BOTH_DEATH_1 = 0,
EMD3_BOTH_DEAD_1,
EMD3_BOTH_DEATH_2,
EMD3_BOTH_DEAD_2,
EMD3_BOTH_DEATH_3,
EMD3_BOTH_DEAD_3,
// Animations for the upper part
EMD3_TORSO_GESTURE,
EMD3_TORSO_ATTACK_1,
EMD3_TORSO_ATTACK_2,
EMD3_TORSO_DROP,
EMD3_TORSO_RAISE,
EMD3_TORSO_STAND_1,
EMD3_TORSO_STAND_2,
// Animations for the lower part
EMD3_LEGS_WALK_CROUCH,
EMD3_LEGS_WALK,
EMD3_LEGS_RUN,
EMD3_LEGS_BACK,
EMD3_LEGS_SWIM,
EMD3_LEGS_JUMP_1,
EMD3_LEGS_LAND_1,
EMD3_LEGS_JUMP_2,
EMD3_LEGS_LAND_2,
EMD3_LEGS_IDLE,
EMD3_LEGS_IDLE_CROUCH,
EMD3_LEGS_TURN,
//! Not an animation, but amount of animation types.
EMD3_ANIMATION_COUNT
};
struct SMD3AnimationInfo
{
s32 first; // First frame
s32 num; // Last frame
s32 looping; // Looping frames
s32 fps; // Frames per second
};
// byte-align structures
#ifdef _MSC_VER
# pragma pack( push, packing )
# pragma pack( 1 )
# define PACK_STRUCT
#elif defined( __GNUC__ )
# define PACK_STRUCT __attribute__((packed))
#else
# error compiler not supported
#endif
// this holds the header info of the MD3 file
struct SMD3Header
{
c8 headerID[4]; //id of file, always "IDP3"
s32 Version; //this is a version number, always 15
s8 fileName[68]; //sometimes left Blank... 65 chars, 32bit aligned == 68 chars
s32 numFrames; //number of KeyFrames
s32 numTags; //number of 'tags' per frame
s32 numMeshes; //number of meshes/skins
s32 numMaxSkins; //maximum number of unique skins used in md3 file
s32 headerSize; //always equal to the length of this header
s32 tagStart; //starting position of tag-structures
s32 tagEnd; //ending position of tag-structures/starting position of mesh-structures
s32 fileSize;
};
struct SMD3MeshHeader
{
c8 meshID[4]; //id, must be IDP3
c8 meshName[68]; //name of mesh 65 chars, 32 bit aligned == 68 chars
s32 numFrames; //number of meshframes in mesh
s32 numShader; //number of skins in mesh
s32 numVertices; //number of vertices
s32 numTriangles; //number of Triangles
s32 offset_triangles; //starting position of Triangle data, relative to start of Mesh_Header
s32 offset_shaders; //size of header
s32 offset_st; //starting position of texvector data, relative to start of Mesh_Header
s32 vertexStart; //starting position of vertex data,relative to start of Mesh_Header
s32 offset_end;
};
//! Compressed Vertex Data
struct SMD3Vertex
{
s16 position[3];
u8 normal[2];
};
//! Texure Coordinate
struct SMD3TexCoord
{
f32 u;
f32 v;
};
//! Triangle Index
struct SMD3Face
{
s32 Index[3];
};
// Default alignment
#ifdef _MSC_VER
# pragma pack( pop, packing )
#endif
#undef PACK_STRUCT
//! Holding Frame Data for a Mesh
struct SMD3MeshBuffer : public IUnknown
{
virtual ~ SMD3MeshBuffer () {}
SMD3MeshHeader MeshHeader;
core::array < core::stringc > Shader;
core::array < s32 > Indices;
core::array < SMD3Vertex > Vertices;
core::array < SMD3TexCoord > Tex;
};
//! hold a tag info for connecting meshes
//! basically its an alternate way to describe a transformation
struct SMD3QuaterionTag
{
SMD3QuaterionTag() {}
SMD3QuaterionTag( const core::stringc& name )
: Name ( name ) {}
// construct from a matrix
SMD3QuaterionTag ( const core::stringc& name, const core::matrix4 &m )
{
Name = name;
position = m.getTranslation ();
rotation = m;
}
// set to matrix
void setto ( core::matrix4 &m )
{
rotation.getMatrix ( m );
m.setTranslation ( position );
}
// construct from a position and euler angles in degrees
SMD3QuaterionTag ( const core::vector3df&pos, const core::vector3df &angle )
{
position = pos;
rotation.set ( angle.X * core::DEGTORAD, angle.Y * core::DEGTORAD, angle.Z * core::DEGTORAD );
}
virtual ~SMD3QuaterionTag() {}
core::stringc Name;
core::vector3df position;
core::quaternion rotation;
bool operator < ( const SMD3QuaterionTag &other ) const
{
return Name < other.Name;
}
};
// holds a assoziative list of named quaternions
struct SMD3QuaterionTagList : public virtual IUnknown
{
SMD3QuaterionTagList () {}
virtual ~SMD3QuaterionTagList () {}
SMD3QuaterionTag* get ( const core::stringc& name )
{
SMD3QuaterionTag search ( name );
s32 index = Container.linear_search ( search );
if ( index >= 0 )
return &Container[index];
return 0;
}
u32 size () const
{
return Container.size();
}
SMD3QuaterionTag& operator[] (u32 index )
{
return Container[index];
}
core::array < SMD3QuaterionTag > Container;
};
//! Holding Frames Buffers and Tag Infos
struct SMD3Mesh: public IUnknown
{
virtual ~SMD3Mesh()
{
for (u32 i=0; i<Buffer.size(); ++i)
Buffer[i]->drop();
};
SMD3Header MD3Header;
core::stringc Name;
core::array < SMD3MeshBuffer * > Buffer;
SMD3QuaterionTagList TagList;
};
//! Interface for using some special functions of MD3 meshes
class IAnimatedMeshMD3 : public IAnimatedMesh
{
public:
//! tune how many frames you want to render inbetween
virtual void setInterpolationShift ( u32 shift, u32 loopMode ) = 0;
virtual SMD3QuaterionTagList *getTagList(s32 frame, s32 detailLevel, s32 startFrameLoop, s32 endFrameLoop) = 0;
virtual SMD3Mesh * getOriginalMesh () = 0;
};
} // end namespace scene
} // end namespace irr
#endif

View File

@ -0,0 +1,51 @@
// Copyright (C) 2002-2007 Nikolaus Gebhardt / Fabio Concas / Thomas Alten
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_ANIMATED_MESH_MS3D_H_INCLUDED__
#define __I_ANIMATED_MESH_MS3D_H_INCLUDED__
#include "IAnimatedMesh.h"
namespace irr
{
namespace scene
{
//! Interface for using some special functions of MS3D meshes
class IAnimatedMeshMS3D : public IAnimatedMesh
{
public:
//! Returns a pointer to a transformation matrix of a part of the
//! mesh based on a frame time. This is used for being able to attach
//! objects to parts of animated meshes. For example a weapon to an animated
//! hand.
//! \param jointNumber: Zero based index of joint. The last joint has the number
//! IAnimatedMeshMS3D::getJointCount()-1;
//! \param frame: Frame of the animation.
//! \return Returns a pointer to the matrix of the mesh part or
//! null if an error occured.
virtual core::matrix4* getMatrixOfJoint(s32 jointNumber, s32 frame) = 0;
//! Gets joint count.
//! \return Returns amount of joints in the skeletal animated mesh.
virtual s32 getJointCount() const = 0;
//! Gets the name of a joint.
//! \param number: Zero based index of joint. The last joint has the number
//! IAnimatedMeshMS3D::getJointCount()-1;
//! \return Returns name of joint and null if an error happened.
virtual const c8* getJointName(s32 number) const = 0;
//! Gets a joint number from its name
//! \param name: Name of the joint.
//! \return Returns the number of the joint or -1 if not found.
virtual s32 getJointNumber(const c8* name) const = 0;
};
} // end namespace scene
} // end namespace irr
#endif

View File

@ -0,0 +1,208 @@
// Copyright (C) 2002-2007 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_ANIMATED_MESH_SCENE_NODE_H_INCLUDED__
#define __I_ANIMATED_MESH_SCENE_NODE_H_INCLUDED__
#include "ISceneNode.h"
#include "IAnimatedMeshMD2.h"
#include "IAnimatedMeshMD3.h"
#include "IShadowVolumeSceneNode.h"
namespace irr
{
namespace scene
{
class IAnimatedMeshSceneNode;
//! Callback interface for catching events of ended animations.
/** Implement this interface and use
IAnimatedMeshSceneNode::setAnimationEndCallback to be able to
be notified if an animation playback has ended.
**/
class IAnimationEndCallBack : public virtual IUnknown
{
public:
//! Will be called when the animation playback has ended.
//! See IAnimatedMeshSceneNode::setAnimationEndCallback for
//! more informations.
//! \param node: Node of which the animation has ended.
virtual void OnAnimationEnd(IAnimatedMeshSceneNode* node) = 0;
};
//! Scene node capable of displaying an animated mesh and its shadow.
/** The shadow is optional: If a shadow should be displayed too, just invoke
the IAnimatedMeshSceneNode::createShadowVolumeSceneNode().*/
class IAnimatedMeshSceneNode : public ISceneNode
{
public:
//! Constructor
IAnimatedMeshSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id,
const core::vector3df& position = core::vector3df(0,0,0),
const core::vector3df& rotation = core::vector3df(0,0,0),
const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f))
: ISceneNode(parent, mgr, id, position, rotation, scale) {}
//! Destructor
virtual ~IAnimatedMeshSceneNode() {};
//! Sets the current frame number.
//! From now on the animation is played from this frame.
//! \param frame: Number of the frame to let the animation be started from.
//! The frame number must be a valid frame number of the IMesh used by this
//! scene node. Set IAnimatedMesh::getMesh() for details.
virtual void setCurrentFrame(s32 frame) = 0;
//! Sets the frame numbers between the animation is looped.
//! The default is 0 - MaximalFrameCount of the mesh.
//! \param begin: Start frame number of the loop.
//! \param end: End frame number of the loop.
//! \return Returns true if successful, false if not.
virtual bool setFrameLoop(s32 begin, s32 end) = 0;
//! Sets the speed with witch the animation is played.
//! \param framesPerSecond: Frames per second played.
virtual void setAnimationSpeed(f32 framesPerSecond) = 0;
//! Creates shadow volume scene node as child of this node
//! and returns a pointer to it. The shadow can be rendered using the ZPass
//! or the zfail method. ZPass is a little bit faster because the shadow volume
//! creation is easier, but with this method there occur ugly looking artifacs
//! when the camera is inside the shadow volume. These error do not occur
//! with the ZFail method.
//! \param id: Id of the shadow scene node. This id can be used to identify
//! the node later.
//! \param zfailmethod: If set to true, the shadow will use the zfail method,
//! if not, zpass is used.
//! \param infinity: Value used by the shadow volume algorithm to scale the
//! shadow volume.
//! \return Returns pointer to the created shadow scene node.
//! This pointer should not be dropped. See IUnknown::drop() for more information.
virtual IShadowVolumeSceneNode* addShadowVolumeSceneNode(s32 id=-1,
bool zfailmethod=true, f32 infinity=10000.0f) = 0;
//! Returns a pointer to a child node, wich has the same transformation as
//! the corresponding joint, if the mesh in this scene node is a ms3d mesh.
//! Otherwise 0 is returned. With this method it is possible to
//! attach scene nodes to joints more easily. In this way, it is
//! for example possible to attach a weapon to the left hand of an
//! animated model. This example shows how:
//! \code
//! ISceneNode* hand =
//! yourMS3DAnimatedMeshSceneNode->getMS3DJointNode("LeftHand");
//! hand->addChild(weaponSceneNode);
//! \endcode
//! Please note that the SceneNode returned by this method may not exist
//! before this call and is created by it.
//! \param jointName: Name of the joint.
//! \return Returns a pointer to the scene node which represents the joint
//! with the specified name. Returns 0 if the contained mesh is not an
//! ms3d mesh or the name of the joint could not be found.
virtual ISceneNode* getMS3DJointNode(const c8* jointName) = 0;
//! Returns a pointer to a child node, which has the same transformation as
//! the corresponding joint, if the mesh in this scene node is a x mesh.
//! Otherwise 0 is returned. With this method it is possible to
//! attach scene nodes to joints more easily. In this way, it is
//! for example possible to attach a weapon to the left hand of an
//! animated model. This example shows how:
//! \code
//! ISceneNode* hand =
//! yourMS3DAnimatedMeshSceneNode->getXJointNode("LeftHand");
//! hand->addChild(weaponSceneNode);
//! \endcode
//! Please note that the SceneNode returned by this method may not exist
//! before this call and is created by it.
//! \param jointName: Name of the joint.
//! \return Returns a pointer to the scene node which represents the joint
//! with the specified name. Returns 0 if the contained mesh is not an
//! ms3d mesh or the name of the joint could not be found.
virtual ISceneNode* getXJointNode(const c8* jointName) = 0;
//! Returns a pointer to a child node, wich has the same transformation as
//! the corresponding joint, if the mesh in this scene node is a b3d mesh.
//! Otherwise 0 is returned. With this method it is possible to
//! attach scene nodes to joints more easily. In this way, it is
//! for example possible to attach a weapon to the left hand of an
//! animated model. This example shows how:
//! \code
//! ISceneNode* hand =
//! yourB3DAnimatedMeshSceneNode->getB3DJointNode("LeftHand");
//! hand->addChild(weaponSceneNode);
//! \endcode
//! Please note that the SceneNode returned by this method may not exist
//! before this call and is created by it.
//! \param jointName: Name of the joint.
//! \return Returns a pointer to the scene node which represents the joint
//! with the specified name. Returns 0 if the contained mesh is not an
//! ms3d mesh or the name of the joint could not be found.
virtual ISceneNode* getB3DJointNode(const c8* jointName) = 0;
//! Starts a default MD2 animation.
//! With this method it is easily possible to start a Run, Attack,
//! Die or whatever animation, if the mesh contained in this scene
//! node is an md2 mesh. Otherwise, nothing happens.
//! \param anim: An MD2 animation type, which should be played, for
//! example EMAT_STAND for the standing animation.
//! \return Returns true if successful, and false if not, for example
//! if the mesh in the scene node is not a md2 mesh.
virtual bool setMD2Animation(EMD2_ANIMATION_TYPE anim) = 0;
//! Starts a special MD2 animation.
//! With this method it is easily possible to start a Run, Attack,
//! Die or whatever animation, if the mesh contained in this scene
//! node is an md2 mesh. Otherwise, nothing happens. This method uses
//! a character string to identify the animation. If the animation is a
//! standard md2 animation, you might want to start this animation
//! with the EMD2_ANIMATION_TYPE enumeration instead.
//! \param animationName: Name of the animation which should be played.
//! \return Returns true if successful, and false if not, for example
//! if the mesh in the scene node is not an md2 mesh, or no animation
//! with this name could be found.
virtual bool setMD2Animation(const c8* animationName) = 0;
//! Returns the current displayed frame number.
virtual s32 getFrameNr() = 0;
//! Returns the current start frame number.
virtual s32 getStartFrame() = 0;
//! Returns the current end frame number.
virtual s32 getEndFrame() = 0;
//! Sets looping mode which is on by default. If set to false,
//! animations will not be played looped.
virtual void setLoopMode(bool playAnimationLooped) = 0;
//! Sets a callback interface which will be called if an animation
//! playback has ended. Set this to 0 to disable the callback again.
//! Please note that this will only be called when in non looped mode,
//! see IAnimatedMeshSceneNode::setLoopMode().
virtual void setAnimationEndCallback(IAnimationEndCallBack* callback=0) = 0;
//! Sets if the scene node should not copy the materials of the mesh but use them in a read only style.
/* In this way it is possible to change the materials a mesh causing all mesh scene nodes
referencing this mesh to change too. */
virtual void setReadOnlyMaterials(bool readonly) = 0;
//! Returns if the scene node should not copy the materials of the mesh but use them in a read only style
virtual bool isReadOnlyMaterials() = 0;
//! Sets a new mesh
virtual void setMesh(IAnimatedMesh* mesh) = 0;
//! Returns the current mesh
virtual IAnimatedMesh* getMesh(void) = 0;
// returns the absolute transformation for a special MD3 Tag if the mesh is a md3 mesh,
// or the absolutetransformation if it's a normal scenenode
virtual const SMD3QuaterionTag& getAbsoluteTransformation( const core::stringc & tagname) = 0;
};
} // end namespace scene
} // end namespace irr
#endif

View File

@ -0,0 +1,80 @@
// Copyright (C) 2002-2007 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_ANIMATED_MESH_X_H_INCLUDED__
#define __I_ANIMATED_MESH_X_H_INCLUDED__
#include "IAnimatedMesh.h"
#include "irrArray.h"
namespace irr
{
namespace scene
{
//! Interface for using some special functions of X meshes
class IAnimatedMeshX : public IAnimatedMesh
{
public:
//! Returns a pointer to a transformation matrix of a part of the
//! mesh based on a frame time. This is used for being able to attach
//! objects to parts of animated meshes. For example a weapon to an animated
//! hand.
//! \param jointNumber: Zero based index of joint. The last joint has the number
//! IAnimatedMeshX::getJointCount()-1;
//! \param frame: Frame of the animation.
//! \return Returns a pointer to the matrix of the mesh part or
//! null if an error occured.
virtual core::matrix4* getMatrixOfJoint(s32 jointNumber, s32 frame) = 0;
//! Gets joint count.
//! \return Returns amount of joints in the skeletal animated mesh.
virtual s32 getJointCount() const = 0;
//! Gets the name of a joint.
//! \param number: Zero based index of joint. The last joint has the number
//! IAnimatedMeshX::getJointCount()-1;
//! \return Returns name of joint and null if an error happened.
virtual const c8* getJointName(s32 number) const = 0;
//! Gets a joint number from its name
//! \param name: Name of the joint.
//! \return Returns the number of the joint or -1 if not found.
virtual s32 getJointNumber(const c8* name) const = 0;
//! Returns a pointer to list of points containing the skeleton.
//! Draw a line between point 1 and 2, and 3 and 4 and 5 and 6
//! and so on to visualize this. Only for debug purposes. If you
//! use an .x-File with the IAnimatedMeshSceneNode and turn DebugDataVisible
//! to true, the Scene node will visualize the skeleton using this
//! method.
virtual const core::array<core::vector3df>* getDrawableSkeleton(s32 frame) = 0;
//! Returns amount of animations in .X-file.
virtual s32 getAnimationCount() const = 0;
//! Returns the name of an animation.
//! \param idx: Zero based Index of the animation. Must be a value between
//! 0 and getAnimationCount()-1;
//! \return Returns pointer to the string of the name of the animation.
//! Returns 0 if an animation with this index does not exist.
virtual const c8* getAnimationName(s32 idx) const = 0;
//! Sets an animation as animation to play back.
//! \param idx: Zero based Index of the animation. Must be a value between
//! 0 and getAnimationCount()-1;
virtual void setCurrentAnimation(s32 idx) = 0;
//! Sets an animation as animation to play back.
//! \param name: Name of the animtion.
//! \return Returns true if successful, and false if the specified animation
//! does not exist.
virtual bool setCurrentAnimation(const c8* name) = 0;
};
} // end namespace scene
} // end namespace irr
#endif

View File

@ -0,0 +1,71 @@
// Copyright (C) 2002-2007 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_ATTRIBUTE_EXCHANGING_OBJECT_H_INCLUDED__
#define __I_ATTRIBUTE_EXCHANGING_OBJECT_H_INCLUDED__
#include "IUnknown.h"
namespace irr
{
namespace io
{
class IAttributes;
//! Enumation flags passed through SAttributeReadWriteOptions to the IAttributeExchangingObject object
enum E_ATTRIBUTE_READ_WRITE_FLAGS
{
//! Serialization/Deserializion is done for an xml file
EARWF_FOR_FILE = 0x00000001,
//! Serialization/Deserializion is done for an editor property box
EARWF_FOR_EDITOR = 0x00000002,
//! When writing filenames, relative paths should be used
EARWF_USE_RELATIVE_PATHS = 0x00000004
};
//! struct holding data describing options
struct SAttributeReadWriteOptions
{
//! constructor
SAttributeReadWriteOptions()
: Flags(0), Filename(0)
{
}
//! Combination of E_ATTRIBUTE_READ_WRITE_FLAGS or other, custom ones
s32 Flags;
//! optional filename
const c8* Filename;
};
//! An object which is able to serialize and deserialize its attributes into an attributes object
class IAttributeExchangingObject : public virtual IUnknown
{
public:
//! Writes attributes of the object.
//! Implement this to expose the attributes of your scene node animator for
//! scripting languages, editors, debuggers or xml serialization purposes.
virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) {}
//! Reads attributes of the object.
//! Implement this to set the attributes of your scene node animator for
//! scripting languages, editors, debuggers or xml deserialization purposes.
virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0) {}
};
} // end namespace io
} // end namespace irr
#endif

View File

@ -0,0 +1,725 @@
// Copyright (C) 2002-2007 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_ATTRIBUTES_H_INCLUDED__
#define __I_ATTRIBUTES_H_INCLUDED__
#include "IUnknown.h"
#include "SColor.h"
#include "vector3d.h"
#include "vector2d.h"
#include "line2d.h"
#include "line3d.h"
#include "triangle3d.h"
#include "quaternion.h"
#include "position2d.h"
#include "rect.h"
#include "matrix4.h"
#include "quaternion.h"
#include "plane3d.h"
#include "triangle3d.h"
#include "line2d.h"
#include "line3d.h"
#include "irrString.h"
#include "irrArray.h"
#include "IXMLReader.h"
namespace irr
{
namespace video
{
class ITexture;
} // end namespace video
namespace io
{
class IXMLWriter;
//! Types of attributes available for IAttributes
enum E_ATTRIBUTE_TYPE
{
// integer attribute
EAT_INT = 0,
// float attribute
EAT_FLOAT,
// string attribute
EAT_STRING,
// boolean attribute
EAT_BOOL,
// enumeration attribute
EAT_ENUM,
// color attribute
EAT_COLOR,
// floating point color attribute
EAT_COLORF,
// 3d vector attribute
EAT_VECTOR3D,
// 2d position attribute
EAT_POSITION2D,
// vector 2d
EAT_VECTOR2D,
// rectangle attribute
EAT_RECT,
// matrix attribute
EAT_MATRIX,
// quaternion attribute
EAT_QUATERNION,
// 3d bounding box
EAT_BBOX,
// plane
EAT_PLANE,
// 3d triangle
EAT_TRIANGLE3D,
// line 2d
EAT_LINE2D,
// line 3d
EAT_LINE3D,
// array of stringws attribute
EAT_STRINGWARRAY,
// array of float
EAT_FLOATARRAY,
// array of int
EAT_INTARRAY,
// binary data attribute
EAT_BINARY,
// texture reference attribute
EAT_TEXTURE,
// known attribute type count
EAT_COUNT,
// unknown attribute
EAT_UNKNOWN
};
//! Provides a generic interface for attributes and their values and the possiblity to serialize them
class IAttributes : public virtual IUnknown
{
public:
//! Returns amount of attributes in this collection of attributes.
virtual s32 getAttributeCount() = 0;
//! Returns attribute name by index.
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
virtual const c8* getAttributeName(s32 index) = 0;
//! Returns the type of an attribute
//! \param attributeName: Name for the attribute
virtual E_ATTRIBUTE_TYPE getAttributeType(const c8* attributeName) = 0;
//! Returns attribute type by index.
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
virtual E_ATTRIBUTE_TYPE getAttributeType(s32 index) = 0;
//! Returns the type string of the attribute
//! \param attributeName: String for the attribute type
virtual const wchar_t* getAttributeTypeString(const c8* attributeName) = 0;
//! Returns the type string of the attribute by index.
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
virtual const wchar_t* getAttributeTypeString(s32 index) = 0;
//! Returns if an attribute with a name exists
virtual bool existsAttribute(const c8* attributeName) = 0;
//! Returns attribute index from name, -1 if not found
virtual s32 findAttribute(const c8* attributeName) = 0;
//! Removes all attributes
virtual void clear() = 0;
//! Reads attributes from a xml file.
//! \param readCurrentElementOnly: If set to true, reading only works if current element has the name 'attributes'.
//! If set to false, the first appearing list attributes are read.
virtual bool read(irr::io::IXMLReader* reader, bool readCurrentElementOnly=false) = 0;
//! Write these attributes into a xml file
//! \param writer: The XML writer to write to
//! \param writeXMLHeader: Writes a header to the XML file, required if at the beginning of the file
//! and you haven't already written one with writer->writeXMLHeader()
virtual bool write(io::IXMLWriter* writer, bool writeXMLHeader=false) = 0;
/*
Integer Attribute
*/
//! Adds an attribute as integer
virtual void addInt(const c8* attributeName, s32 value) = 0;
//! Sets an attribute as integer value
virtual void setAttribute(const c8* attributeName, s32 value) = 0;
//! Gets an attribute as integer value
//! \param attributeName: Name of the attribute to get.
//! \return Returns value of the attribute previously set by setAttribute()
virtual s32 getAttributeAsInt(const c8* attributeName) = 0;
//! Gets an attribute as integer value
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
virtual s32 getAttributeAsInt(s32 index) = 0;
//! Sets an attribute as integer value
virtual void setAttribute(s32 index, s32 value) = 0;
/*
Float Attribute
*/
//! Adds an attribute as float
virtual void addFloat(const c8* attributeName, f32 value) = 0;
//! Sets a attribute as float value
virtual void setAttribute(const c8* attributeName, f32 value) = 0;
//! Gets an attribute as float value
//! \param attributeName: Name of the attribute to get.
//! \return Returns value of the attribute previously set by setAttribute()
virtual f32 getAttributeAsFloat(const c8* attributeName) = 0;
//! Gets an attribute as float value
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
virtual f32 getAttributeAsFloat(s32 index) = 0;
//! Sets an attribute as float value
virtual void setAttribute(s32 index, f32 value) = 0;
/*
String Attribute
*/
//! Adds an attribute as string
virtual void addString(const c8* attributeName, const c8* value) = 0;
//! Sets an attribute value as string.
//! \param attributeName: Name for the attribute
//! \param value: Value for the attribute. Set this to 0 to delete the attribute
virtual void setAttribute(const c8* attributeName, const c8* value) = 0;
//! Gets an attribute as string.
//! \param attributeName: Name of the attribute to get.
//! \return Returns value of the attribute previously set by setAttribute()
//! or 0 if attribute is not set.
virtual core::stringc getAttributeAsString(const c8* attributeName) = 0;
//! Gets an attribute as string.
//! \param attributeName: Name of the attribute to get.
//! \param target: Buffer where the string is copied to.
virtual void getAttributeAsString(const c8* attributeName, c8* target) = 0;
//! Returns attribute value as string by index.
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
virtual core::stringc getAttributeAsString(s32 index) = 0;
//! Sets an attribute value as string.
//! \param attributeName: Name for the attribute
virtual void setAttribute(s32 index, const c8* value) = 0;
// wide strings
//! Adds an attribute as string
virtual void addString(const c8* attributeName, const wchar_t* value) = 0;
//! Sets an attribute value as string.
//! \param attributeName: Name for the attribute
//! \param value: Value for the attribute. Set this to 0 to delete the attribute
virtual void setAttribute(const c8* attributeName, const wchar_t* value) = 0;
//! Gets an attribute as string.
//! \param attributeName: Name of the attribute to get.
//! \return Returns value of the attribute previously set by setAttribute()
//! or 0 if attribute is not set.
virtual core::stringw getAttributeAsStringW(const c8* attributeName) = 0;
//! Gets an attribute as string.
//! \param attributeName: Name of the attribute to get.
//! \param target: Buffer where the string is copied to.
virtual void getAttributeAsStringW(const c8* attributeName, wchar_t* target) = 0;
//! Returns attribute value as string by index.
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
virtual core::stringw getAttributeAsStringW(s32 index) = 0;
//! Sets an attribute value as string.
//! \param attributeName: Name for the attribute
virtual void setAttribute(s32 index, const wchar_t* value) = 0;
/*
Binary Data Attribute
*/
//! Adds an attribute as binary data
virtual void addBinary(const c8* attributeName, void* data, s32 dataSizeInBytes) = 0;
//! Sets an attribute as binary data
virtual void setAttribute(const c8* attributeName, void* data, s32 dataSizeInBytes ) = 0;
//! Gets an attribute as binary data
//! \param attributeName: Name of the attribute to get.
virtual void getAttributeAsBinaryData(const c8* attributeName, void* outData, s32 maxSizeInBytes) = 0;
//! Gets an attribute as binary data
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
virtual void getAttributeAsBinaryData(s32 index, void* outData, s32 maxSizeInBytes) = 0;
//! Sets an attribute as binary data
virtual void setAttribute(s32 index, void* data, s32 dataSizeInBytes ) = 0;
/*
Array Attribute
*/
//! Adds an attribute as wide string array
virtual void addArray(const c8* attributeName, core::array<core::stringw> value) = 0;
//! Sets an attribute value as a wide string array.
//! \param attributeName: Name for the attribute
//! \param value: Value for the attribute. Set this to 0 to delete the attribute
virtual void setAttribute(const c8* attributeName, const core::array<core::stringw> value) = 0;
//! Gets an attribute as an array of wide strings.
//! \param attributeName: Name of the attribute to get.
//! \return Returns value of the attribute previously set by setAttribute()
//! or 0 if attribute is not set.
virtual core::array<core::stringw> getAttributeAsArray(const c8* attributeName) = 0;
//! Returns attribute value as an array of wide strings by index.
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
virtual core::array<core::stringw> getAttributeAsArray(s32 index) = 0;
//! Sets an attribute as an array of wide strings
virtual void setAttribute(s32 index, core::array<core::stringw> value) = 0;
/*
Bool Attribute
*/
//! Adds an attribute as bool
virtual void addBool(const c8* attributeName, bool value) = 0;
//! Sets an attribute as boolean value
virtual void setAttribute(const c8* attributeName, bool value) = 0;
//! Gets an attribute as boolean value
//! \param attributeName: Name of the attribute to get.
//! \return Returns value of the attribute previously set by setAttribute()
virtual bool getAttributeAsBool(const c8* attributeName) = 0;
//! Gets an attribute as boolean value
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
virtual bool getAttributeAsBool(s32 index) = 0;
//! Sets an attribute as boolean value
virtual void setAttribute(s32 index, bool value) = 0;
/*
Enumeration Attribute
*/
//! Adds an attribute as enum
virtual void addEnum(const c8* attributeName, const c8* enumValue, const c8* const* enumerationLiterals) = 0;
//! Adds an attribute as enum
virtual void addEnum(const c8* attributeName, s32 enumValue, const c8* const* enumerationLiterals) = 0;
//! Sets an attribute as enumeration
virtual void setAttribute(const c8* attributeName, const c8* enumValue, const c8* const* enumerationLiterals) = 0;
//! Gets an attribute as enumeration
//! \param attributeName: Name of the attribute to get.
//! \return Returns value of the attribute previously set by setAttribute()
virtual const c8* getAttributeAsEnumeration(const c8* attributeName) = 0;
//! Gets an attribute as enumeration
//! \param attributeName: Name of the attribute to get.
//! \param enumerationLiteralsToUse: Use these enumeration literals to get the index value instead of the set ones.
//! This is useful when the attribute list maybe was read from an xml file, and only contains the enumeration string, but
//! no information about its index.
//! \return Returns value of the attribute previously set by setAttribute()
virtual s32 getAttributeAsEnumeration(const c8* attributeName, const c8* const* enumerationLiteralsToUse) = 0;
//! Gets an attribute as enumeration
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
virtual s32 getAttributeAsEnumeration(s32 index, const c8* const* enumerationLiteralsToUse) = 0;
//! Gets an attribute as enumeration
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
virtual const c8* getAttributeAsEnumeration(s32 index) = 0;
//! Gets the list of enumeration literals of an enumeration attribute
//! \param attributeName: Name of the attribute to get.
virtual void getAttributeEnumerationLiteralsOfEnumeration(const c8* attributeName, core::array<core::stringc>& outLiterals) = 0;
//! Gets the list of enumeration literals of an enumeration attribute
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
virtual void getAttributeEnumerationLiteralsOfEnumeration(s32 index, core::array<core::stringc>& outLiterals) = 0;
//! Sets an attribute as enumeration
virtual void setAttribute(s32 index, const c8* enumValue, const c8* const* enumerationLiterals) = 0;
/*
SColor Attribute
*/
//! Adds an attribute as color
virtual void addColor(const c8* attributeName, video::SColor value) = 0;
//! Sets a attribute as color
virtual void setAttribute(const c8* attributeName, video::SColor color) = 0;
//! Gets an attribute as color
//! \param attributeName: Name of the attribute to get.
//! \return Returns value of the attribute previously set by setAttribute()
virtual video::SColor getAttributeAsColor(const c8* attributeName) = 0;
//! Gets an attribute as color
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
virtual video::SColor getAttributeAsColor(s32 index) = 0;
//! Sets an attribute as color
virtual void setAttribute(s32 index, video::SColor color) = 0;
/*
SColorf Attribute
*/
//! Adds an attribute as floating point color
virtual void addColorf(const c8* attributeName, video::SColorf value) = 0;
//! Sets a attribute as floating point color
virtual void setAttribute(const c8* attributeName, video::SColorf color) = 0;
//! Gets an attribute as floating point color
//! \param attributeName: Name of the attribute to get.
//! \return Returns value of the attribute previously set by setAttribute()
virtual video::SColorf getAttributeAsColorf(const c8* attributeName) = 0;
//! Gets an attribute as floating point color
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
virtual video::SColorf getAttributeAsColorf(s32 index) = 0;
//! Sets an attribute as floating point color
virtual void setAttribute(s32 index, video::SColorf color) = 0;
/*
Vector3d Attribute
*/
//! Adds an attribute as 3d vector
virtual void addVector3d(const c8* attributeName, core::vector3df value) = 0;
//! Sets a attribute as 3d vector
virtual void setAttribute(const c8* attributeName, core::vector3df v) = 0;
//! Gets an attribute as 3d vector
//! \param attributeName: Name of the attribute to get.
//! \return Returns value of the attribute previously set by setAttribute()
virtual core::vector3df getAttributeAsVector3d(const c8* attributeName) = 0;
//! Gets an attribute as 3d vector
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
virtual core::vector3df getAttributeAsVector3d(s32 index) = 0;
//! Sets an attribute as vector
virtual void setAttribute(s32 index, core::vector3df v) = 0;
/*
Position2d Attribute
*/
//! Adds an attribute as 2d position
virtual void addPosition2d(const c8* attributeName, core::position2di value) = 0;
//! Sets a attribute as 2d position
virtual void setAttribute(const c8* attributeName, core::position2di v) = 0;
//! Gets an attribute as position
//! \param attributeName: Name of the attribute to get.
//! \return Returns value of the attribute previously set by setAttribute()
virtual core::position2di getAttributeAsPosition2d(const c8* attributeName) = 0;
//! Gets an attribute as position
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
virtual core::position2di getAttributeAsPosition2d(s32 index) = 0;
//! Sets an attribute as 2d position
virtual void setAttribute(s32 index, core::position2di v) = 0;
/*
Rectangle Attribute
*/
//! Adds an attribute as rectangle
virtual void addRect(const c8* attributeName, core::rect<s32> value) = 0;
//! Sets an attribute as rectangle
virtual void setAttribute(const c8* attributeName, core::rect<s32> v) = 0;
//! Gets an attribute as rectangle
//! \param attributeName: Name of the attribute to get.
//! \return Returns value of the attribute previously set by setAttribute()
virtual core::rect<s32> getAttributeAsRect(const c8* attributeName) = 0;
//! Gets an attribute as rectangle
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
virtual core::rect<s32> getAttributeAsRect(s32 index) = 0;
//! Sets an attribute as rectangle
virtual void setAttribute(s32 index, core::rect<s32> v) = 0;
/*
matrix attribute
*/
//! Adds an attribute as matrix
virtual void addMatrix(const c8* attributeName, core::matrix4 v) = 0;
//! Sets an attribute as matrix
virtual void setAttribute(const c8* attributeName, core::matrix4 v) = 0;
//! Gets an attribute as a matrix4
//! \param attributeName: Name of the attribute to get.
//! \return Returns value of the attribute previously set by setAttribute()
virtual core::matrix4 getAttributeAsMatrix(const c8* attributeName) = 0;
//! Gets an attribute as matrix
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
virtual core::matrix4 getAttributeAsMatrix(s32 index) = 0;
//! Sets an attribute as matrix
virtual void setAttribute(s32 index, core::matrix4 v) = 0;
/*
quaternion attribute
*/
//! Adds an attribute as quaternion
virtual void addQuaternion(const c8* attributeName, core::quaternion v) = 0;
//! Sets an attribute as quaternion
virtual void setAttribute(const c8* attributeName, core::quaternion v) = 0;
//! Gets an attribute as a quaternion
//! \param attributeName: Name of the attribute to get.
//! \return Returns value of the attribute previously set by setAttribute()
virtual core::quaternion getAttributeAsQuaternion(const c8* attributeName) = 0;
//! Gets an attribute as quaternion
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
virtual core::quaternion getAttributeAsQuaternion(s32 index) = 0;
//! Sets an attribute as quaternion
virtual void setAttribute(s32 index, core::quaternion v) = 0;
/*
3d bounding box
*/
//! Adds an attribute as axis aligned bounding box
virtual void addBox3d(const c8* attributeName, core::aabbox3df v) = 0;
//! Sets an attribute as axis aligned bounding box
virtual void setAttribute(const c8* attributeName, core::aabbox3df v) = 0;
//! Gets an attribute as a axis aligned bounding box
//! \param attributeName: Name of the attribute to get.
//! \return Returns value of the attribute previously set by setAttribute()
virtual core::aabbox3df getAttributeAsBox3d(const c8* attributeName) = 0;
//! Gets an attribute as axis aligned bounding box
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
virtual core::aabbox3df getAttributeAsBox3d(s32 index) = 0;
//! Sets an attribute as axis aligned bounding box
virtual void setAttribute(s32 index, core::aabbox3df v) = 0;
/*
plane
*/
//! Adds an attribute as 3d plane
virtual void addPlane3d(const c8* attributeName, core::plane3df v) = 0;
//! Sets an attribute as 3d plane
virtual void setAttribute(const c8* attributeName, core::plane3df v) = 0;
//! Gets an attribute as a 3d plane
//! \param attributeName: Name of the attribute to get.
//! \return Returns value of the attribute previously set by setAttribute()
virtual core::plane3df getAttributeAsPlane3d(const c8* attributeName) = 0;
//! Gets an attribute as 3d plane
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
virtual core::plane3df getAttributeAsPlane3d(s32 index) = 0;
//! Sets an attribute as 3d plane
virtual void setAttribute(s32 index, core::plane3df v) = 0;
/*
3d triangle
*/
//! Adds an attribute as 3d triangle
virtual void addTriangle3d(const c8* attributeName, core::triangle3df v) = 0;
//! Sets an attribute as 3d trianle
virtual void setAttribute(const c8* attributeName, core::triangle3df v) = 0;
//! Gets an attribute as a 3d triangle
//! \param attributeName: Name of the attribute to get.
//! \return Returns value of the attribute previously set by setAttribute()
virtual core::triangle3df getAttributeAsTriangle3d(const c8* attributeName) = 0;
//! Gets an attribute as 3d triangle
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
virtual core::triangle3df getAttributeAsTriangle3d(s32 index) = 0;
//! Sets an attribute as 3d triangle
virtual void setAttribute(s32 index, core::triangle3df v) = 0;
/*
line 2d
*/
//! Adds an attribute as a 2d line
virtual void addLine2d(const c8* attributeName, core::line2df v) = 0;
//! Sets an attribute as a 2d line
virtual void setAttribute(const c8* attributeName, core::line2df v) = 0;
//! Gets an attribute as a 2d line
//! \param attributeName: Name of the attribute to get.
//! \return Returns value of the attribute previously set by setAttribute()
virtual core::line2df getAttributeAsLine2d(const c8* attributeName) = 0;
//! Gets an attribute as a 2d line
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
virtual core::line2df getAttributeAsLine2d(s32 index) = 0;
//! Sets an attribute as a 2d line
virtual void setAttribute(s32 index, core::line2df v) = 0;
/*
line 3d
*/
//! Adds an attribute as a 3d line
virtual void addLine3d(const c8* attributeName, core::line3df v) = 0;
//! Sets an attribute as a 3d line
virtual void setAttribute(const c8* attributeName, core::line3df v) = 0;
//! Gets an attribute as a 3d line
//! \param attributeName: Name of the attribute to get.
//! \return Returns value of the attribute previously set by setAttribute()
virtual core::line3df getAttributeAsLine3d(const c8* attributeName) = 0;
//! Gets an attribute as a 3d line
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
virtual core::line3df getAttributeAsLine3d(s32 index) = 0;
//! Sets an attribute as a 3d line
virtual void setAttribute(s32 index, core::line3df v) = 0;
/*
Texture Attribute
*/
//! Adds an attribute as texture reference
virtual void addTexture(const c8* attributeName, video::ITexture* texture) = 0;
//! Sets an attribute as texture reference
virtual void setAttribute(const c8* attributeName, video::ITexture* texture ) = 0;
//! Gets an attribute as texture reference
//! \param attributeName: Name of the attribute to get.
virtual video::ITexture* getAttributeAsTexture(const c8* attributeName) = 0;
//! Gets an attribute as texture reference
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
virtual video::ITexture* getAttributeAsTexture(s32 index) = 0;
//! Sets an attribute as texture reference
virtual void setAttribute(s32 index, video::ITexture* texture) = 0;
};
} // end namespace io
} // end namespace irr
#endif

View File

@ -0,0 +1,56 @@
// Copyright (C) 2002-2007 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_BILLBOARD_SCENE_NODE_H_INCLUDED__
#define __I_BILLBOARD_SCENE_NODE_H_INCLUDED__
#include "ISceneNode.h"
namespace irr
{
namespace scene
{
//! A billboard scene node.
/** A billboard is like a 3d sprite: A 2d element,
which always looks to the camera. It is usually used for explosions, fire,
lensflares, particles and things like that.
*/
class IBillboardSceneNode : public ISceneNode
{
public:
//! constructor
IBillboardSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id,
const core::vector3df& position = core::vector3df(0,0,0))
: ISceneNode(parent, mgr, id, position) {}
//! Sets the size of the billboard.
virtual void setSize(const core::dimension2d<f32>& size) = 0;
//! Returns the size of the billboard.
virtual const core::dimension2d<f32>& getSize() = 0;
//! Set the color of all vertices of the billboard
//! \param overallColor: the color to set
virtual void setColor(const video::SColor & overallColor) = 0;
//! Set the color of the top and bottom vertices of the billboard
//! \param topColor: the color to set the top vertices
//! \param bottomColor: the color to set the bottom vertices
virtual void setColor(const video::SColor & topColor, const video::SColor & bottomColor) = 0;
//! Gets the color of the top and bottom vertices of the billboard
//! \param[out] topColor: stores the color of the top vertices
//! \param[out] bottomColor: stores the color of the bottom vertices
virtual void getColor(video::SColor & topColor, video::SColor & bottomColor) = 0;
};
} // end namespace scene
} // end namespace irr
#endif

View File

@ -0,0 +1,149 @@
// Copyright (C) 2002-2007 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_CAMERA_SCENE_NODE_H_INCLUDED__
#define __I_CAMERA_SCENE_NODE_H_INCLUDED__
#include "ISceneNode.h"
#include "IEventReceiver.h"
#include "SViewFrustum.h"
namespace irr
{
namespace scene
{
//! Scene Node which is a (controlable) camera.
/** The whole scene will be
rendered from the cameras point of view. Because the ICameraScenNode
is a SceneNode, it can be attached to any other scene node, and will
follow its parents movement, rotation and so on.
*/
class ICameraSceneNode : public ISceneNode, public IEventReceiver
{
public:
//! Constructor
ICameraSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id,
const core::vector3df& position = core::vector3df(0,0,0),
const core::vector3df& rotation = core::vector3df(0,0,0),
const core::vector3df& scale = core::vector3df(1.0f,1.0f,1.0f))
: ISceneNode(parent, mgr, id, position, rotation, scale), IsOrthogonal(false) {}
//! Destructor
virtual ~ICameraSceneNode() {};
//! Sets the projection matrix of the camera.
/** The core::matrix4 class has some methods
to build a projection matrix. e.g: core::matrix4::buildProjectionMatrixPerspectiveFovLH.
Note that the matrix will only stay as set by this method until one of
the following Methods are called: setNearValue, setFarValue, setAspectRatio, setFOV.
\param projection: The new projection matrix of the camera. */
virtual void setProjectionMatrix(const core::matrix4& projection) = 0;
//! Gets the current projection matrix of the camera.
/** \return Returns the current projection matrix of the camera. */
virtual const core::matrix4& getProjectionMatrix() = 0;
//! Gets the current view matrix of the camera.
/** \return Returns the current view matrix of the camera. */
virtual const core::matrix4& getViewMatrix() = 0;
//! It is possible to send mouse and key events to the camera.
/** Most cameras
may ignore this input, but camera scene nodes which are created for
example with ISceneManager::addMayaCameraSceneNode or
ISceneManager::addMeshViewerCameraSceneNode, may want to get this input
for changing their position, look at target or whatever. */
virtual bool OnEvent(SEvent event) = 0;
//! Sets the look at target of the camera
/** \param pos: Look at target of the camera. */
virtual void setTarget(const core::vector3df& pos) = 0;
//! Gets the current look at target of the camera
/** \return Returns the current look at target of the camera */
virtual core::vector3df getTarget() const = 0;
//! Sets the up vector of the camera.
/** \param pos: New upvector of the camera. */
virtual void setUpVector(const core::vector3df& pos) = 0;
//! Gets the up vector of the camera.
/** \return Returns the up vector of the camera. */
virtual core::vector3df getUpVector() const = 0;
//! Gets the value of the near plane of the camera.
/** \return Returns the value of the near plane of the camera. */
virtual f32 getNearValue() = 0;
//! Gets the value of the far plane of the camera.
/** \return Returns the value of the far plane of the camera. */
virtual f32 getFarValue() = 0;
//! Gets the aspect ratio of the camera.
/** \return Returns the aspect ratio of the camera. */
virtual f32 getAspectRatio() = 0;
//! Gets the field of view of the camera.
/** \return Returns the field of view of the camera in radiants. */
virtual f32 getFOV() = 0;
//! Sets the value of the near clipping plane. (default: 1.0f)
/** \param zn: New z near value. */
virtual void setNearValue(f32 zn) = 0;
//! Sets the value of the far clipping plane (default: 2000.0f)
/** \param zf: New z far value. */
virtual void setFarValue(f32 zf) = 0;
//! Sets the aspect ratio (default: 4.0f / 3.0f)
/** \param aspect: New aspect ratio. */
virtual void setAspectRatio(f32 aspect) = 0;
//! Sets the field of view (Default: PI / 2.5f)
/** \param fovy: New field of view in radiants. */
virtual void setFOV(f32 fovy) = 0;
//! Returns the view frustum.
/** Needed sometimes by bspTree or LOD render nodes.
\return Returns the current view frustum. */
virtual const SViewFrustum* getViewFrustum() const = 0;
//! Disables or enables the camera to get key or mouse inputs.
/** If this is set to true, the camera will respond to key inputs
otherwise not. */
virtual void setInputReceiverEnabled(bool enabled) = 0;
//! Returns if the input receiver of the camera is currently enabled.
virtual bool isInputReceiverEnabled() = 0;
//! Returns if a camera is orthogonal.
/** This setting does not change anything of the view or projection matrix. However
it influences how collision detection and picking is done with this camera. */
virtual bool isOrthogonal()
{
_IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
return IsOrthogonal;
}
//! Sets if this camera should return if it is orthogonal.
/** This setting does not change anything of the view or projection matrix. However
it influences how collision detection and picking is done with this camera. */
void setIsOrthogonal( bool orthogonal )
{
IsOrthogonal = orthogonal;
}
private:
bool IsOrthogonal;
};
} // end namespace scene
} // end namespace irr
#endif

View File

@ -0,0 +1,71 @@
// Copyright (C) 2002-2007 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_CURSOR_CONTROL_H_INCLUDED__
#define __I_CURSOR_CONTROL_H_INCLUDED__
#include "position2d.h"
#include "IUnknown.h"
#include "irrTypes.h"
namespace irr
{
namespace gui
{
//! Interface to manipulate the mouse cursor.
class ICursorControl : public virtual IUnknown
{
public:
//! Changes the visible state of the mouse cursor.
/** \param visible: The new visible state. If true, the cursor will be visible,
if false, it will be invisible. */
virtual void setVisible(bool visible) = 0;
//! Returns if the cursor is currently visible.
/** \return Returns true if the cursor is visible, false if not. */
virtual bool isVisible() = 0;
//! Sets the new position of the cursor.
/** \param pos: New position of the cursor. The position must be between
(0.0f, 0.0f) and (1.0f, 1.0f), where (0.0f, 0.0f) is
the top left corner and (1.0f, 1.0f) is the bottom right corner of the
render window. */
virtual void setPosition(const core::position2d<f32> &pos) = 0;
//! Sets the new position of the cursor.
/** \param pos: New position of the cursor. The position must be between
(0.0f, 0.0f) and (1.0f, 1.0f), where (0.0f, 0.0f) is
the top left corner and (1.0f, 1.0f) is the bottom right corner of the
render window. */
virtual void setPosition(f32 x, f32 y) = 0;
//! Sets the new position of the cursor.
/** \param pos: New position of the cursor. The coordinates are pixel units. */
virtual void setPosition(const core::position2d<s32> &pos) = 0;
//! Sets the new position of the cursor.
/** \param pos: New position of the cursor. The coordinates are pixel units. */
virtual void setPosition(s32 x, s32 y) = 0;
//! Returns the current position of the mouse cursor.
/** \return Returns the current position of the cursor. The returned position
is the position of the mouse cursor in pixel units. */
virtual core::position2d<s32> getPosition() = 0;
//! Returns the current position of the mouse cursor.
/** \return Returns the current position of the cursor. The returned position
is a value between (0.0f, 0.0f) and (1.0f, 1.0f), where (0.0f, 0.0f) is
the top left corner and (1.0f, 1.0f) is the bottom right corner of the
render window. */
virtual core::position2d<f32> getRelativePosition() = 0;
};
} // end namespace gui
} // end namespace irr
#endif

View File

@ -0,0 +1,42 @@
// Copyright (C) 2002-2007 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_DUMMY_TRANSFORMATION_SCENE_NODE_H_INCLUDED__
#define __I_DUMMY_TRANSFORMATION_SCENE_NODE_H_INCLUDED__
#include "ISceneNode.h"
namespace irr
{
namespace scene
{
//! Dummy scene node for adding additional transformations to the scene graph.
/** This scene node does not render itself, and does not respond to set/getPosition,
set/getRotation and set/getScale. Its just a simple scene node that takes a
matrix as relative transformation, making it possible to insert any transformation
anywhere into the scene graph.
This scene node is for example used by the IAnimatedMeshSceneNode for emulating
joint scene nodes when playing skeletal animations.
*/
class IDummyTransformationSceneNode : public ISceneNode
{
public:
//! constructor
IDummyTransformationSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id)
: ISceneNode(parent, mgr, id) {}
//! Returns a reference to the current relative transformation matrix.
//! This is the matrix, this scene node uses instead of scale, translation
//! and rotation.
virtual core::matrix4& getRelativeTransformationMatrix() = 0;
};
} // end namespace scene
} // end namespace irr
#endif

View File

@ -0,0 +1,225 @@
// Copyright (C) 2002-2007 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_EVENT_RECEIVER_H_INCLUDED__
#define __I_EVENT_RECEIVER_H_INCLUDED__
#include "ILogger.h"
#include "position2d.h"
#include "Keycodes.h"
namespace irr
{
//! Enumeration for all event types there are.
enum EEVENT_TYPE
{
//! An event of the graphical user interface.
EET_GUI_EVENT = 0,
//! A mouse input event.
EET_MOUSE_INPUT_EVENT,
//! A key input evant.
EET_KEY_INPUT_EVENT,
//! A log event
EET_LOG_TEXT_EVENT,
//! A user event with user data. This is not used by Irrlicht and can be used
//! to send user specific data though the system.
EET_USER_EVENT
};
//! Enumeration for all mouse input events
enum EMOUSE_INPUT_EVENT
{
//! Left mouse button was pressed down.
EMIE_LMOUSE_PRESSED_DOWN = 0,
//! Right mouse button was pressed down.
EMIE_RMOUSE_PRESSED_DOWN,
//! Middle mouse button was pressed down.
EMIE_MMOUSE_PRESSED_DOWN,
//! Left mouse button was left up.
EMIE_LMOUSE_LEFT_UP,
//! Right mouse button was left up.
EMIE_RMOUSE_LEFT_UP,
//! Middle mouse button was left up.
EMIE_MMOUSE_LEFT_UP,
//! The mouse cursor changed its position.
EMIE_MOUSE_MOVED,
//! The mouse wheel was moved. Use Wheel value in event data to find out
//! in what direction and how fast.
EMIE_MOUSE_WHEEL,
//! No real event. Just for convenience to get number of events
EMIE_COUNT
};
namespace gui
{
class IGUIElement;
//! Enumeration for all events which are sendable by the gui system
enum EGUI_EVENT_TYPE
{
//! A gui element has lost its focus.
EGET_ELEMENT_FOCUS_LOST = 0,
//! A gui element has got the focus.
EGET_ELEMENT_FOCUSED,
//! A gui element was hovered.
EGET_ELEMENT_HOVERED,
//! A hovered gui element was left
EGET_ELEMENT_LEFT,
//! A button was clicked.
EGET_BUTTON_CLICKED,
//! A scrollbar has changed its position.
EGET_SCROLL_BAR_CHANGED,
//! A checkbox has changed its check state.
EGET_CHECKBOX_CHANGED,
//! A new item in a listbox was seleted.
EGET_LISTBOX_CHANGED,
//! An item in the listbox was selected, which was already selected.
EGET_LISTBOX_SELECTED_AGAIN,
//! A file has been selected in the file dialog
EGET_FILE_SELECTED,
//! A file open dialog has been closed without choosing a file
EGET_FILE_CHOOSE_DIALOG_CANCELLED,
//! 'Yes' was clicked on a messagebox
EGET_MESSAGEBOX_YES,
//! 'No' was clicked on a messagebox
EGET_MESSAGEBOX_NO,
//! 'OK' was clicked on a messagebox
EGET_MESSAGEBOX_OK,
//! 'Cancel' was clicked on a messagebox
EGET_MESSAGEBOX_CANCEL,
//! In an editbox was pressed 'ENTER'
EGET_EDITBOX_ENTER,
//! The tab was changed in an tab control
EGET_TAB_CHANGED,
//! A menu item was selected in a (context) menu
EGET_MENU_ITEM_SELECTED,
//! The selection in a combo box has been changed
EGET_COMBO_BOX_CHANGED
};
} // end namespace gui
//! Struct for holding event data. An event can be a gui, mouse or keyboard event.
struct SEvent
{
EEVENT_TYPE EventType;
union
{
struct
{
//! IGUIElement who called the event
gui::IGUIElement* Caller;
//! Type of GUI Event
gui::EGUI_EVENT_TYPE EventType;
} GUIEvent;
struct
{
//! X position of mouse cursor
s32 X;
//! Y position of mouse cursor
s32 Y;
//! mouse wheel delta, usually 1.0 or -1.0.
/** Only valid if event was EMIE_MOUSE_WHEEL */
f32 Wheel;
//! type of mouse event
EMOUSE_INPUT_EVENT Event;
} MouseInput;
struct
{
//! Character corresponding to the key (0, if not a character)
wchar_t Char;
//! Key which has been pressed or released
EKEY_CODE Key;
//! if not pressed, then the key was left up
bool PressedDown;
//! true if shift was also pressed
bool Shift;
//! true if ctrl was also pressed
bool Control;
} KeyInput;
struct
{
//! pointer to text which has been logged
const c8* Text;
//! log level in which the text has been logged
ELOG_LEVEL Level;
} LogEvent;
struct
{
//! Some user specified data as int
s32 UserData1;
//! Another user specified data as int
s32 UserData2;
//! Some user specified data as float
f32 UserData3;
} UserEvent;
};
};
//! Interface of an object wich can receive events.
class IEventReceiver
{
public:
virtual ~IEventReceiver() {};
//! called if an event happened. returns true if event was processed
virtual bool OnEvent(SEvent event) = 0;
};
} // end namespace irr
#endif

View File

@ -0,0 +1,58 @@
// Copyright (C) 2002-2007 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_FILE_LIST_H_INCLUDED__
#define __I_FILE_LIST_H_INCLUDED__
#include "IUnknown.h"
namespace irr
{
namespace io
{
//! The Filelist lists all files in a directory.
class IFileList : public virtual IUnknown
{
public:
//! destructor
virtual ~IFileList() {};
//! Returns the amount of files in the filelist.
//! \return
//! Returns the amount of files and directories in the file list.
virtual s32 getFileCount() = 0;
//! Gets the name of a file in the list, based on an index.
//! The path is not included in this name. Use getFullFileName for this.
//! \param index is the zero based index of the file which name should
//! be returned. The index has to be smaller than the amount getFileCount() returns.
//! \return
//! Returns the file name of the file. Returns 0, if an error occured.
virtual const c8* getFileName(s32 index) = 0;
//! Gets the full name of a file in the list, path included, based on an index.
//! \param index is the zero based index of the file which name should
//! be returned. The index has to be smaller than the amount getFileCount() returns.
//! \return
//! Returns the file name of the file. Returns 0, if an error occured.
virtual const c8* getFullFileName(s32 index) = 0;
//! Returns of the file is a directory
//! \param
//! index is the zero based index of the file which name should
//! be returned. The index has to be smaller than the amount getFileCount() returns.
//! \return
//! Returns true, if the file is a directory, and false, if it is not.
//! If an error occurs, the result is undefined.
virtual bool isDirectory(s32 index) = 0;
};
} // end namespace irr
} // end namespace io
#endif

View File

@ -0,0 +1,193 @@
// Copyright (C) 2002-2007 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_FILE_SYSTEM_H_INCLUDED__
#define __I_FILE_SYSTEM_H_INCLUDED__
#include "IUnknown.h"
#include "IXMLReader.h"
#include "irrString.h"
namespace irr
{
namespace video
{
class IVideoDriver;
} // end namespace video
namespace io
{
class IReadFile;
class IWriteFile;
class IFileList;
class IXMLWriter;
class IAttributes;
//! The FileSystem manages files and archives and provides access to them.
/**
It manages where files are, so that modules which
use the the IO do not need to know where every file is located. A file
could be in a .zip-Archive or as file on disk, using the IFileSystem
makes no difference to this.
*/
class IFileSystem : public virtual IUnknown
{
public:
//! destructor
virtual ~IFileSystem() {};
//! Opens a file for read access.
/** \param filename: Name of file to open.
\return Returns a pointer to the created file interface.
The returned pointer should be dropped when no longer needed.
See IUnknown::drop() for more information. */
virtual IReadFile* createAndOpenFile(const c8* filename) = 0;
//! Creates an IReadFile interface for accessing memory like a file.
/** This allows you to use a pointer to memory where an IReadFile is requested.
\param memory: A pointer to the start of the file in memory
\param len: The length of the memory in bytes
\param fileName: The name given to this file
\param deleteMemoryWhenDropped: True if the memory should be deleted
along with the IReadFile when it is dropped.
\return Returns a pointer to the created file interface.
The returned pointer should be dropped when no longer needed.
See IUnknown::drop() for more information.
*/
virtual IReadFile* createMemoryReadFile(void* memory, s32 len, const c8* fileName, bool deleteMemoryWhenDropped=false) = 0;
//! Opens a file for write access.
/** \param filename: Name of file to open.
\param append: If the file already exist, all write operations are
appended to the file.
\return Returns a pointer to the created file interface. 0 is returned, if the
file could not created or opened for writing.
The returned pointer should be dropped when no longer needed.
See IUnknown::drop() for more information. */
virtual IWriteFile* createAndWriteFile(const c8* filename, bool append=false) = 0;
//! Adds an zip archive to the file system.
/** After calling this, the Irrlicht Engine will search and open files directly from this archive too.
This is useful for hiding data from the end user, speeding up file access and making it possible to
access for example Quake3 .pk3 files, which are nothing different than .zip files.
\param filename: Filename of the zip archive to add to the file system.
\param ignoreCase: If set to true, files in the archive can be accessed without
writing all letters in the right case.
\param ignorePaths: If set to true, files in the added archive can be accessed
without its complete path.
\return Returns true if the archive was added successful, false if not. */
virtual bool addZipFileArchive(const c8* filename, bool ignoreCase = true, bool ignorePaths = true) = 0;
//! Adds an unzipped archive ( or basedirectory with subdirectories..) to the file system.
/** Useful for handling data which will be in a zip file
\param filename: Filename of the unzipped zip archive base directory to add to the file system.
\param ignoreCase: If set to true, files in the archive can be accessed without
writing all letters in the right case.
\param ignorePaths: If set to true, files in the added archive can be accessed
without its complete path.
\return Returns true if the archive was added successful, false if not. */
virtual bool addFolderFileArchive(const c8* filename, bool ignoreCase = true, bool ignorePaths = true) = 0;
//! Adds an pak archive to the file system.
/** After calling this, the Irrlicht Engine will search and open files directly from this archive too.
This is useful for hiding data from the end user, speeding up file access and making it possible to
access for example Quake2/KingPin/Hexen2 .pak files
\param filename: Filename of the pak archive to add to the file system.
\param ignoreCase: If set to true, files in the archive can be accessed without
writing all letters in the right case.
\param ignorePaths: If set to true, files in the added archive can be accessed
without its complete path.(should not use with Quake2 paks
\return Returns true if the archive was added successful, false if not. */
virtual bool addPakFileArchive(const c8* filename, bool ignoreCase = true, bool ignorePaths = true) = 0;
//! Returns the string of the current working directory.
virtual const c8* getWorkingDirectory() = 0;
//! Changes the current Working Directory to the overgiven string.
/** \param ewDirectory is a string specifiing the new working directory.
The string is operating system dependent. Under Windows it has
the form "<drive>:\<directory>\<sudirectory>\<..>". An example would be: "C:\Windows\"
\return Returns true if successful, otherwise false. */
virtual bool changeWorkingDirectoryTo(const c8* newDirectory) = 0;
//! Converts a relative path to an absolute (unique) path, resolving symbolic links if required
virtual irr::core::stringc getAbsolutePath(irr::core::stringc &filename) = 0;
//! Creates a list of files and directories in the current working directory and returns it.
/** \return a Pointer to the created IFileList is returned. After the list has been used
it has to be deleted using its IFileList::drop() method.
See IUnknown::drop() for more information. */
virtual IFileList* createFileList() = 0;
//! Determinates if a file exists and would be able to be opened.
/** \param filename is the string identifying the file which should be tested for existance.
\return Returns true if file exsits, and false if it does not exist or an error occured. */
virtual bool existFile(const c8* filename) = 0;
//! Creates a XML Reader from a file which returns all parsed strings as wide characters (wchar_t*).
/** Use createXMLReaderUTF8() if you prefer char* instead of wchar_t*. See IIrrXMLReader for
more information on how to use the parser.
\return 0, if file could not be opened, otherwise a pointer to the created
IXMLReader is returned. After use, the reader
has to be deleted using its IXMLReader::drop() method.
See IUnknown::drop() for more information. */
virtual IXMLReader* createXMLReader(const c8* filename) = 0;
//! Creates a XML Reader from a file which returns all parsed strings as wide characters (wchar_t*).
/** Use createXMLReaderUTF8() if you prefer char* instead of wchar_t*. See IIrrXMLReader for
more information on how to use the parser.
\return 0, if file could not be opened, otherwise a pointer to the created
IXMLReader is returned. After use, the reader
has to be deleted using its IXMLReader::drop() method.
See IUnknown::drop() for more information. */
virtual IXMLReader* createXMLReader(IReadFile* file) = 0;
//! Creates a XML Reader from a file which returns all parsed strings as ASCII/UTF-8 characters (char*).
/** Use createXMLReader() if you prefer wchar_t* instead of char*. See IIrrXMLReader for
more information on how to use the parser.
\return 0, if file could not be opened, otherwise a pointer to the created
IXMLReader is returned. After use, the reader
has to be deleted using its IXMLReaderUTF8::drop() method.
See IUnknown::drop() for more information. */
virtual IXMLReaderUTF8* createXMLReaderUTF8(const c8* filename) = 0;
//! Creates a XML Reader from a file which returns all parsed strings as ASCII/UTF-8 characters (char*).
/** Use createXMLReader() if you prefer wchar_t* instead of char*. See IIrrXMLReader for
more information on how to use the parser.
\return 0, if file could not be opened, otherwise a pointer to the created
IXMLReader is returned. After use, the reader
has to be deleted using its IXMLReaderUTF8::drop() method.
See IUnknown::drop() for more information. */
virtual IXMLReaderUTF8* createXMLReaderUTF8(IReadFile* file) = 0;
//! Creates a XML Writer from a file.
/** \return 0, if file could not be opened, otherwise a pointer to the created
IXMLWriter is returned. After use, the reader
has to be deleted using its IXMLWriter::drop() method.
See IUnknown::drop() for more information. */
virtual IXMLWriter* createXMLWriter(const c8* filename) = 0;
//! Creates a XML Writer from a file.
/** \return 0, if file could not be opened, otherwise a pointer to the created
IXMLWriter is returned. After use, the reader
has to be deleted using its IXMLWriter::drop() method.
See IUnknown::drop() for more information. */
virtual IXMLWriter* createXMLWriter(IWriteFile* file) = 0;
//! Creates a new empty collection of attributes, usable for serialization and more.
/** \param: driver: Video driver to be used to load textures when specified as attribute values.
Can be null to prevent automatic texture loading by attributes.
\return Returns a pointer to the created object.
If you no longer need the object, you should call IAttributes::drop().
See IUnknown::drop() for more information. */
virtual IAttributes* createEmptyAttributes(video::IVideoDriver* driver=0) = 0;
};
} // end namespace io
} // end namespace irr
#endif

View File

@ -0,0 +1,219 @@
// Copyright (C) 2002-2007 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_GPU_PROGRAMMING_SERVICES_H_INCLUDED__
#define __I_GPU_PROGRAMMING_SERVICES_H_INCLUDED__
#include "IUnknown.h"
#include "SMaterial.h"
namespace irr
{
namespace io
{
class IReadFile;
} // end namespace io
namespace video
{
class IVideoDriver;
class IShaderConstantSetCallBack;
//! Compile target enumeration for the addHighLevelShaderMaterial() method.
enum E_VERTEX_SHADER_TYPE
{
EVST_VS_1_1 = 0,
EVST_VS_2_0,
EVST_VS_2_a,
EVST_VS_3_0,
//! This is not a type, but a value indicating how much types there are.
EVST_COUNT
};
//! Names for all vertex shader types, each entry corresponds to a E_VERTEX_SHADER_TYPE entry.
const c8* const VERTEX_SHADER_TYPE_NAMES[] = {
"vs_1_1",
"vs_2_0",
"vs_2_a",
"vs_3_0",
0 };
//! Compile target enumeration for the addHighLevelShaderMaterial() method.
enum E_PIXEL_SHADER_TYPE
{
EPST_PS_1_1 = 0,
EPST_PS_1_2,
EPST_PS_1_3,
EPST_PS_1_4,
EPST_PS_2_0,
EPST_PS_2_a,
EPST_PS_2_b,
EPST_PS_3_0,
//! This is not a type, but a value indicating how much types there are.
EPST_COUNT
};
//! Names for all pixel shader types, each entry corresponds to a E_PIXEL_SHADER_TYPE entry.
const c8* const PIXEL_SHADER_TYPE_NAMES[] = {
"ps_1_1",
"ps_1_2",
"ps_1_3",
"ps_1_4",
"ps_2_0",
"ps_2_a",
"ps_2_b",
"ps_3_0",
0 };
//! Interface making it possible to create and use programs running on the GPU.
class IGPUProgrammingServices
{
public:
//! destructor
virtual ~IGPUProgrammingServices() {}
//! Adds a new material renderer to the VideoDriver, based on a high level shading
//! language. Currently only HLSL/D3D9 and GLSL/OpenGL is supported.
//! \param vertexShaderProgram: String containing the source of the vertex shader program.
//! This can be 0 if no vertex program should be used.
//! \param Entry name of the function of the vertexShaderProgram
//! \param vsCompileTarget: Vertex shader version where the high level shader should be compiled to.
//! \param pixelShaderProgram: String containing the source of the pixel shader program.
//! This can be 0 if no pixel shader should be used.
//! \param pixelShaderEntryPointName: Entry name of the function of the pixelShaderEntryPointName
//! \param psCompileTarget: Pixel shader version where the high level shader should be compiled to.
//! \param callback: Pointer to an implementation of IShaderConstantSetCallBack in which you
//! can set the needed vertex and pixel shader program constants. Set this to 0 if you don't need this.
//! \param baseMaterial: Base material which renderstates will be used to shade the
//! material.
//! \param userData: a user data int. This int can be set to any value and will be set as parameter
//! in the callback method when calling OnSetConstants(). In this way it is easily possible to
//! use the same callback method for multiple materials and distinguish between them during the call.
//! \return Returns the number of the
//! material type which can be set in SMaterial::MaterialType to use the renderer.
//! -1 is returned if an error occured. -1 is returned for example if a vertex or pixel shader
//! program could not be compiled or a compile target is not reachable.
//! The error strings are then printed out into the error log, and
//! can be catched with a custom event receiver.
virtual s32 addHighLevelShaderMaterial(
const c8* vertexShaderProgram,
const c8* vertexShaderEntryPointName = "main",
E_VERTEX_SHADER_TYPE vsCompileTarget = EVST_VS_1_1,
const c8* pixelShaderProgram = 0,
const c8* pixelShaderEntryPointName = "main",
E_PIXEL_SHADER_TYPE psCompileTarget = EPST_PS_1_1,
IShaderConstantSetCallBack* callback = 0,
E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID,
s32 userData = 0 ) = 0;
//! Like IGPUProgrammingServices::addShaderMaterial() (look there for a detailed description),
//! but tries to load the programs from files.
//! \param vertexShaderProgram: Text file containing the source of the vertex shader program.
//! Set to null if no shader should be created.
//! \param pixelShaderProgram: Text file containing the source of the pixel shader program. Set to
//! 0 if no shader should be created.
virtual s32 addHighLevelShaderMaterialFromFiles(
const c8* vertexShaderProgram,
const c8* vertexShaderEntryPointName = "main",
E_VERTEX_SHADER_TYPE vsCompileTarget = EVST_VS_1_1,
const c8* pixelShaderProgram = 0,
const c8* pixelShaderEntryPointName = "main",
E_PIXEL_SHADER_TYPE psCompileTarget = EPST_PS_1_1,
IShaderConstantSetCallBack* callback = 0,
E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID,
s32 userData = 0) = 0;
//! Like IGPUProgrammingServices::addShaderMaterial() (look there for a detailed description),
//! but tries to load the programs from files.
//! \param vertexShaderProgram: Text file containing the source of the vertex shader program.
//! Set to null if no shader should be created.
//! \param pixelShaderProgram: Text file containing the source of the pixel shader program. Set to
//! 0 if no shader should be created.
virtual s32 addHighLevelShaderMaterialFromFiles(
io::IReadFile* vertexShaderProgram,
const c8* vertexShaderEntryPointName = "main",
E_VERTEX_SHADER_TYPE vsCompileTarget = EVST_VS_1_1,
io::IReadFile* pixelShaderProgram = 0,
const c8* pixelShaderEntryPointName = "main",
E_PIXEL_SHADER_TYPE psCompileTarget = EPST_PS_1_1,
IShaderConstantSetCallBack* callback = 0,
E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID,
s32 userData = 0) = 0;
//! Adds a new material renderer to the VideoDriver, using pixel and/or
//! vertex shaders to render geometry.
//! Note that it is a good idea to call IVideoDriver::queryFeature() before to check
//! if the IVideoDriver supports the vertex and/or pixel shader version your are using.
//! The material is added to the VideoDriver like with IVideoDriver::addMaterialRenderer()
//! and can be used like it had been added with that method.
//! \param vertexShaderProgram: String containing the source of the vertex shader program. This can be
//! 0 if no vertex program should be used.
//! For DX8 programs, the will always input registers look like this:
//! v0: position, v1: normal,
//! v2: color, v3: texture cooridnates, v4: texture coordinates 2 if available.
//! For DX9 programs, you can manually set the registers using the dcl_ statements.
//! \param pixelShaderProgram: String containing the source of the pixel shader program.
//! This can be 0 if you don't want to use a pixel shader.
//! \param callback: Pointer to an implementation of IShaderConstantSetCallBack in which you
//! can set the needed vertex and pixel shader program constants. Set this to 0 if you don't need this.
//! \param baseMaterial: Base material which renderstates will be used to shade the
//! material.
//! \param userData: a user data int. This int can be set to any value and will be set as parameter
//! in the callback method when calling OnSetConstants(). In this way it is easily possible to
//! use the same callback method for multiple materials and distinguish between them during the call.
//! \return Returns the number of the
//! material type which can be set in SMaterial::MaterialType to use the renderer.
//! -1 is returned if an error occured. -1 is returned for example if a vertex or pixel shader
//! program could not be compiled, the error strings are then printed out into the error log, and
//! can be catched with a custom event receiver.
virtual s32 addShaderMaterial(const c8* vertexShaderProgram = 0,
const c8* pixelShaderProgram = 0,
IShaderConstantSetCallBack* callback = 0,
E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID,
s32 userData = 0) = 0;
//! Like IGPUProgrammingServices::addShaderMaterial(), but tries to load the
//! programs from files.
//! \param vertexShaderProgram: Text file containing the source of the vertex shader program.
//! Set to null if no shader should be created.
//! \param pixelShaderProgram: Text file containing the source of the pixel shader program. Set to
//! 0 if no shader should be created.
//! \param callback: Pointer to an IShaderConstantSetCallback object to which the
//! OnSetConstants function is called.
//! \param baseMaterial: baseMaterial
virtual s32 addShaderMaterialFromFiles(io::IReadFile* vertexShaderProgram,
io::IReadFile* pixelShaderProgram,
IShaderConstantSetCallBack* callback = 0,
E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID,
s32 userData = 0) = 0;
//! Like IGPUProgrammingServices::addShaderMaterial(), but tries to load the
//! programs from files.
//! \param vertexShaderProgramFileName: Text file name containing the source of the
//! vertex shader program.
//! Set to null if no shader should be created.
//! \param pixelShaderProgramFileName: Text file name containing the source of the
//! pixel shader program. Set to 0 if no shader should be created.
//! \param callback: Pointer to an IShaderConstantSetCallback object to which the
//! OnSetConstants function is called.
//! \param baseMaterial: baseMaterial
virtual s32 addShaderMaterialFromFiles(const c8* vertexShaderProgramFileName,
const c8* pixelShaderProgramFileName,
IShaderConstantSetCallBack* callback = 0,
E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID,
s32 userData = 0) = 0;
};
} // end namespace video
} // end namespace irr
#endif

View File

@ -0,0 +1,130 @@
// Copyright (C) 2002-2007 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_GUI_BUTTON_H_INCLUDED__
#define __I_GUI_BUTTON_H_INCLUDED__
#include "IGUIElement.h"
namespace irr
{
namespace video
{
class ITexture;
} // end namespace video
namespace gui
{
class IGUIFont;
class IGUISpriteBank;
enum EGUI_BUTTON_STATE
{
//! The button is not pressed
EGBS_BUTTON_UP=0,
//! The button is currently pressed down
EGBS_BUTTON_DOWN,
//! The mouse cursor is over the button
EGBS_BUTTON_MOUSE_OVER,
//! The mouse cursor is not over the button
EGBS_BUTTON_MOUSE_OFF,
//! The button has the focus
EGBS_BUTTON_FOCUSED,
//! The button doesn't have the focus
EGBS_BUTTON_NOT_FOCUSED,
//! not used, counts the number of enumerated items
EGBS_COUNT
};
//! Names for gui button state icons
const c8* const GUIButtonStateNames[] =
{
"buttonUp",
"buttonDown",
"buttonMouseOver",
"buttonMouseOff",
"buttonFocused",
"buttonNotFocused",
0,
0,
};
//! GUI Button interface.
class IGUIButton : public IGUIElement
{
public:
//! constructor
IGUIButton(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
: IGUIElement(EGUIET_BUTTON, environment, parent, id, rectangle) {}
//! destructor
~IGUIButton() {};
//! Sets another skin independent font.
/** If this is set to zero, the button uses the font of the skin.
\param font: New font to set. */
virtual void setOverrideFont(IGUIFont* font=0) = 0;
//! Sets an image which should be displayed on the button when it is in normal state.
/** \param image: Image to be displayed */
virtual void setImage(video::ITexture* image) = 0;
//! Sets a background image for the button when it is in normal state.
/** \param image: Texture containing the image to be displayed
\param pos: Position in the texture, where the image is located */
virtual void setImage(video::ITexture* image, const core::rect<s32>& pos) = 0;
//! Sets a background image for the button when it is in pressed state.
/** If no images is specified for the pressed state via
setPressedImage(), this image is also drawn in pressed state.
\param image: Image to be displayed */
virtual void setPressedImage(video::ITexture* image) = 0;
//! Sets an image which should be displayed on the button when it is in pressed state.
/** \param image: Texture containing the image to be displayed
\param pos: Position in the texture, where the image is located */
virtual void setPressedImage(video::ITexture* image, const core::rect<s32>& pos) = 0;
//! Sets the sprite bank used by the button
virtual void setSpriteBank(IGUISpriteBank* bank) = 0;
//! Sets the animated sprite for a specific button state
/** \param index: Number of the sprite within the sprite bank, use -1 for no sprite
\param state: State of the button to set the sprite for
\param index: The sprite number from the current sprite bank
\param color: The color of the sprite
\param loop: True if the animation should loop, false if not
*/
virtual void setSprite(EGUI_BUTTON_STATE state, s32 index,
video::SColor color=video::SColor(255,255,255,255), bool loop=false) = 0;
//! Sets if the button should behave like a push button.
/** Which means it can be in two states: Normal or Pressed. With a click on the button,
the user can change the state of the button. */
virtual void setIsPushButton(bool isPushButton) = 0;
//! Sets the pressed state of the button if this is a pushbutton
virtual void setPressed(bool pressed) = 0;
//! Returns if the button is currently pressed
virtual bool isPressed() = 0;
//! Sets if the alpha channel should be used for drawing background images on the button (default is false)
virtual void setUseAlphaChannel(bool useAlphaChannel) = 0;
//! Returns if the alpha channel should be used for drawing background images on the button
virtual bool getUseAlphaChannel() = 0;
//! Sets if the button should use the skin to draw its border (default is true)
virtual void setDrawBorder(bool border) = 0;
};
} // end namespace gui
} // end namespace irr
#endif

View File

@ -0,0 +1,38 @@
// Copyright (C) 2002-2007 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_GUI_CHECKBOX_H_INCLUDED__
#define __I_GUI_CHECKBOX_H_INCLUDED__
#include "IGUIElement.h"
namespace irr
{
namespace gui
{
//! GUI Check box interface.
class IGUICheckBox : public IGUIElement
{
public:
//! constructor
IGUICheckBox(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
: IGUIElement(EGUIET_CHECK_BOX, environment, parent, id, rectangle) {}
//! destructor
~IGUICheckBox() {};
//! Set if box is checked.
virtual void setChecked(bool checked) = 0;
//! Returns true if box is checked.
virtual bool isChecked() = 0;
};
} // end namespace gui
} // end namespace irr
#endif

View File

@ -0,0 +1,35 @@
// Copyright (C) 2002-2007 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_GUI_COLOR_SELECT_DIALOG_H_INCLUDED__
#define __I_GUI_COLOR_SELECT_DIALOG_H_INCLUDED__
#include "IGUIElement.h"
namespace irr
{
namespace gui
{
//! Standard file chooser dialog.
class IGUIColorSelectDialog : public IGUIElement
{
public:
//! constructor
IGUIColorSelectDialog(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
: IGUIElement(EGUIET_COLOR_SELECT_DIALOG, environment, parent, id, rectangle) {}
//! destructor
virtual ~IGUIColorSelectDialog() {};
};
} // end namespace gui
} // end namespace irr
#endif

View File

@ -0,0 +1,51 @@
// Copyright (C) 2002-2007 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_GUI_COMBO_BOX_H_INCLUDED__
#define __I_GUI_COMBO_BOX_H_INCLUDED__
#include "IGUIElement.h"
namespace irr
{
namespace gui
{
//! Combobox widget
class IGUIComboBox : public IGUIElement
{
public:
//! constructor
IGUIComboBox(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
: IGUIElement(EGUIET_COMBO_BOX, environment, parent, id, rectangle) {}
//! destructor
~IGUIComboBox() {};
//! Returns amount of items in box
virtual s32 getItemCount() = 0;
//! returns string of an item. the idx may be a value from 0 to itemCount-1
virtual const wchar_t* getItem(s32 idx) = 0;
//! adds an item and returns the index of it
virtual s32 addItem(const wchar_t* text) = 0;
//! deletes all items in the combo box
virtual void clear() = 0;
//! returns id of selected item. returns -1 if no item is selected.
virtual s32 getSelected() = 0;
//! sets the selected item. Set this to -1 if no item should be selected
virtual void setSelected(s32 id) = 0;
};
} // end namespace gui
} // end namespace irr
#endif

View File

@ -0,0 +1,103 @@
// Copyright (C) 2002-2007 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_GUI_CONTEXT_MENU_H_INCLUDED__
#define __I_GUI_CONTEXT_MENU_H_INCLUDED__
#include "IGUIElement.h"
namespace irr
{
namespace gui
{
//! GUI Context menu interface.
class IGUIContextMenu : public IGUIElement
{
public:
//! constructor
IGUIContextMenu(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
: IGUIElement(EGUIET_CONTEXT_MENU, environment, parent, id, rectangle) {}
//! destructor
~IGUIContextMenu() {};
//! Returns amount of menu items
virtual s32 getItemCount() const = 0;
//! Adds a menu item.
/** \param text: Text of menu item. Set this to 0 to create
an separator instead of a real item, which is the same like
calling addSeparator();
\param commandId: Command id of menu item, a simple id you may
set to whatever you want.
\param enabled: Specifies if the menu item should be enabled.
\param hasSubMenu: Set this to true if there should be a submenu
at this item. You can acess this submenu via getSubMenu().
\return Returns the index of the new item */
virtual s32 addItem(const wchar_t* text, s32 commandId=-1, bool enabled=true,
bool hasSubMenu=false,
bool checked=false
) = 0;
//! Adds a separator item to the menu
virtual void addSeparator() = 0;
//! Returns text of the menu item.
/** \param idx: Zero based index of the menu item */
virtual const wchar_t* getItemText(s32 idx) = 0;
//! Sets text of the menu item.
/** \param idx: Zero based index of the menu item
\param text: New text of the item. */
virtual void setItemText(s32 idx, const wchar_t* text) = 0;
//! Returns if a menu item is enabled
/** \param idx: Zero based index of the menu item */
virtual bool isItemEnabled(s32 idx) = 0;
//! Sets if the menu item should be enabled.
/** \param idx: Zero based index of the menu item
\param enabled: True if it is enabled, otherwise false. */
virtual void setItemEnabled(s32 idx, bool enabled) = 0;
//! Sets if the menu item should be checked.
/** \param idx: Zero based index of the menu item
\param enabled: True if it is enabled, otherwise false. */
virtual void setItemChecked(s32 idx, bool enabled) = 0;
//! Removes a menu item
/** \param idx: Zero based index of the menu item */
virtual void removeItem(s32 idx) = 0;
//! Removes all menu items
virtual void removeAllItems() = 0;
//! Returns the selected item in the menu
/** \return Index of the selected item, -1 if none selected. */
virtual s32 getSelectedItem() = 0;
//! Returns command id of a menu item
/** \param idx: Zero based index of the menu item */
virtual s32 getItemCommandId(s32 idx) = 0;
//! Sets the command id of a menu item
/** \param idx: Zero based index of the menu item
\param id: Command id of menu item, a simple id you may
set to whatever you want. */
virtual void setItemCommandId(s32 idx, s32 id) = 0;
//! \return Returns a pointer to the submenu of an item.
/** 0 is returned if there is no submenu
\param idx: Zero based index of the menu item */
virtual IGUIContextMenu* getSubMenu(s32 idx) = 0;
};
} // end namespace gui
} // end namespace irr
#endif

View File

@ -0,0 +1,64 @@
// Copyright (C) 2002-2007 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_GUI_EDIT_BOX_H_INCLUDED__
#define __I_GUI_EDIT_BOX_H_INCLUDED__
#include "IGUIElement.h"
#include "SColor.h"
namespace irr
{
namespace gui
{
class IGUIFont;
//! Single line edit box for editing simple text.
class IGUIEditBox : public IGUIElement
{
public:
//! constructor
IGUIEditBox(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
: IGUIElement(EGUIET_EDIT_BOX, environment, parent, id, rectangle) {}
//! destructor
~IGUIEditBox() {};
//! Sets another skin independent font.
/** If this is set to zero, the button uses the font of the skin.
\param font: New font to set. */
virtual void setOverrideFont(IGUIFont* font=0) = 0;
//! Sets another color for the text.
/** If set, the edit box does not use the EGDC_BUTTON_TEXT color defined
in the skin, but the set color instead. You don't need to call
IGUIEditBox::enableOverrrideColor(true) after this, this is done
by this function.
If you set a color, and you want the text displayed with the color
of the skin again, call IGUIEditBox::enableOverrideColor(false);
\param color: New color of the text. */
virtual void setOverrideColor(video::SColor color) = 0;
//! Sets if the text should use the overide color or the color in the gui skin.
/** \param enable: If set to true, the override color, which can be set
with IGUIEditBox::setOverrideColor is used, otherwise the
EGDC_BUTTON_TEXT color of the skin. */
virtual void enableOverrideColor(bool enable) = 0;
//! Sets the maximum amount of characters which may be entered in the box.
/** \param max: Maximum amount of characters. If 0, the character amount is
infinity. */
virtual void setMax(s32 max) = 0;
//! Returns maximum amount of characters, previously set by setMax();
virtual s32 getMax() = 0;
};
} // end namespace gui
} // end namespace irr
#endif

View File

@ -0,0 +1,706 @@
// Copyright (C) 2002-2007 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_GUI_ELEMENT_H_INCLUDED__
#define __I_GUI_ELEMENT_H_INCLUDED__
#include "IUnknown.h"
#include "irrList.h"
#include "rect.h"
#include "irrString.h"
#include "IEventReceiver.h"
#include "EGUIElementTypes.h"
#include "IAttributes.h"
#include "IAttributeExchangingObject.h"
namespace irr
{
namespace gui
{
class IGUIEnvironment;
enum EGUI_ALIGNMENT
{
//! Aligned to parent's top or left side (default)
EGUIA_UPPERLEFT=0,
//! Aligned to parent's bottom or right side
EGUIA_LOWERRIGHT,
//! Aligned to the center of parent
EGUIA_CENTER,
//! Scaled within its parent
EGUIA_SCALE
};
//! Names for alignments
const c8* const GUIAlignmentNames[] =
{
"upperLeft",
"lowerRight",
"center",
"scale",
0
};
//! Base class of all GUI elements.
class IGUIElement : public virtual io::IAttributeExchangingObject, public IEventReceiver
{
public:
//! Constructor
IGUIElement(EGUI_ELEMENT_TYPE type, IGUIEnvironment* environment, IGUIElement* parent,
s32 id, core::rect<s32> rectangle)
: Parent(0), RelativeRect(rectangle), AbsoluteRect(rectangle),
AbsoluteClippingRect(rectangle), DesiredRect(rectangle),
MaxSize(0,0), MinSize(1,1), IsVisible(true), IsEnabled(true),
IsSubElement(false), NoClip(false), ID(id),
AlignLeft(EGUIA_UPPERLEFT), AlignRight(EGUIA_UPPERLEFT), AlignTop(EGUIA_UPPERLEFT), AlignBottom(EGUIA_UPPERLEFT),
Environment(environment), Type(type)
{
// if we were given a parent to attach to
if (parent)
parent->addChild(this);
// if we succeeded in becoming a child
if (Parent)
{
LastParentRect = Parent->getAbsolutePosition();
AbsoluteRect += LastParentRect.UpperLeftCorner;
AbsoluteClippingRect = AbsoluteRect;
AbsoluteClippingRect.clipAgainst(Parent->AbsoluteClippingRect);
}
}
//! Destructor
virtual ~IGUIElement()
{
// delete all children
core::list<IGUIElement*>::Iterator it = Children.begin();
for (; it != Children.end(); ++it)
{
(*it)->Parent = 0;
(*it)->drop();
}
};
//! Returns parent of this element.
IGUIElement* getParent() const
{
return Parent;
}
//! Returns the relative rectangle of this element.
core::rect<s32> getRelativePosition() const
{
return RelativeRect;
}
//! Sets the relative rectangle of this element.
void setRelativePosition(const core::rect<s32>& r)
{
if (Parent)
{
core::rect<s32> r2(Parent->getAbsolutePosition());
core::dimension2df d((f32)r2.getSize().Width, (f32)r2.getSize().Height);
if (AlignLeft == EGUIA_SCALE)
ScaleRect.UpperLeftCorner.X = (f32)r.UpperLeftCorner.X / d.Width;
if (AlignRight == EGUIA_SCALE)
ScaleRect.LowerRightCorner.X = (f32)r.LowerRightCorner.X / d.Width;
if (AlignTop == EGUIA_SCALE)
ScaleRect.UpperLeftCorner.Y = (f32)r.UpperLeftCorner.Y / d.Height;
if (AlignBottom == EGUIA_SCALE)
ScaleRect.LowerRightCorner.Y = (f32)r.LowerRightCorner.Y / d.Height;
}
DesiredRect = r;
updateAbsolutePosition();
}
//! Sets the relative rectangle of this element.
void setRelativePosition(const core::rect<f32>& r)
{
if (!Parent)
return;
core::rect<s32> r2(Parent->getAbsolutePosition());
core::dimension2di d(r2.getSize());
DesiredRect = core::rect<s32>(
(s32)((f32)d.Width * r.UpperLeftCorner.X),
(s32)((f32)d.Height * r.UpperLeftCorner.Y),
(s32)((f32)d.Width * r.LowerRightCorner.X),
(s32)((f32)d.Height * r.LowerRightCorner.Y));
ScaleRect = r;
updateAbsolutePosition();
}
//! Returns the absolute rectangle of element.
core::rect<s32> getAbsolutePosition() const
{
return AbsoluteRect;
}
//! Sets whether the element will ignore its parent's clipping rectangle
void setNotClipped(bool noClip)
{
NoClip = noClip;
}
//! Gets whether the element will ignore its parent's clipping rectangle
bool isNotClipped()
{
return NoClip;
}
//! Sets the maximum size allowed for this element
/** If set to 0,0, there is no maximum size */
void setMaxSize(core::dimension2di size)
{
MaxSize = size;
updateAbsolutePosition();
}
//! Sets the minimum size allowed for this element
void setMinSize(core::dimension2di size)
{
MinSize = size;
if (MinSize.Width < 1)
MinSize.Width = 1;
if (MinSize.Height < 1)
MinSize.Height = 1;
updateAbsolutePosition();
}
void setAlignment(EGUI_ALIGNMENT left, EGUI_ALIGNMENT right, EGUI_ALIGNMENT top, EGUI_ALIGNMENT bottom)
{
AlignLeft = left;
AlignRight = right;
AlignTop = top;
AlignBottom = bottom;
if (Parent)
{
core::rect<s32> r(Parent->getAbsolutePosition());
core::dimension2df d((f32)r.getSize().Width, (f32)r.getSize().Height);
if (AlignLeft == EGUIA_SCALE)
ScaleRect.UpperLeftCorner.X = (f32)DesiredRect.UpperLeftCorner.X / d.Width;
if (AlignRight == EGUIA_SCALE)
ScaleRect.LowerRightCorner.X = (f32)DesiredRect.LowerRightCorner.X / d.Width;
if (AlignTop == EGUIA_SCALE)
ScaleRect.UpperLeftCorner.Y = (f32)DesiredRect.UpperLeftCorner.Y / d.Height;
if (AlignBottom == EGUIA_SCALE)
ScaleRect.LowerRightCorner.Y = (f32)DesiredRect.LowerRightCorner.Y / d.Height;
}
}
//! Updates the absolute position.
virtual void updateAbsolutePosition()
{
core::rect<s32> parentAbsolute(0,0,0,0);
core::rect<s32> parentAbsoluteClip;
s32 diffx, diffy;
f32 fw=0.f, fh=0.f;
if (Parent)
{
parentAbsolute = Parent->AbsoluteRect;
if (NoClip)
{
IGUIElement* p=this;
while (p && p->NoClip && p->Parent)
p = p->Parent;
if (p->Parent)
parentAbsoluteClip = p->Parent->AbsoluteClippingRect;
else
parentAbsoluteClip = p->AbsoluteClippingRect;
}
else
parentAbsoluteClip = Parent->AbsoluteClippingRect;
}
diffx = parentAbsolute.getWidth() - LastParentRect.getWidth();
diffy = parentAbsolute.getHeight() - LastParentRect.getHeight();
if (AlignLeft == EGUIA_SCALE || AlignRight == EGUIA_SCALE)
fw = (f32)parentAbsolute.getWidth();
if (AlignTop == EGUIA_SCALE || AlignBottom == EGUIA_SCALE)
fh = (f32)parentAbsolute.getHeight();
switch (AlignLeft)
{
case EGUIA_UPPERLEFT:
break;
case EGUIA_LOWERRIGHT:
DesiredRect.UpperLeftCorner.X += diffx;
break;
case EGUIA_CENTER:
DesiredRect.UpperLeftCorner.X += diffx/2;
break;
case EGUIA_SCALE:
DesiredRect.UpperLeftCorner.X = (s32)(ScaleRect.UpperLeftCorner.X * fw);
break;
}
switch (AlignRight)
{
case EGUIA_UPPERLEFT:
break;
case EGUIA_LOWERRIGHT:
DesiredRect.LowerRightCorner.X += diffx;
break;
case EGUIA_CENTER:
DesiredRect.LowerRightCorner.X += diffx/2;
break;
case EGUIA_SCALE:
DesiredRect.LowerRightCorner.X = (s32)(ScaleRect.LowerRightCorner.X * fw);
break;
}
switch (AlignTop)
{
case EGUIA_UPPERLEFT:
break;
case EGUIA_LOWERRIGHT:
DesiredRect.UpperLeftCorner.Y += diffy;
break;
case EGUIA_CENTER:
DesiredRect.UpperLeftCorner.Y += diffy/2;
break;
case EGUIA_SCALE:
DesiredRect.UpperLeftCorner.Y = (s32)(ScaleRect.UpperLeftCorner.Y * fh);
break;
}
switch (AlignBottom)
{
case EGUIA_UPPERLEFT:
break;
case EGUIA_LOWERRIGHT:
DesiredRect.LowerRightCorner.Y += diffy;
break;
case EGUIA_CENTER:
DesiredRect.LowerRightCorner.Y += diffy/2;
break;
case EGUIA_SCALE:
DesiredRect.LowerRightCorner.Y = (s32)(ScaleRect.LowerRightCorner.Y * fh);
break;
}
RelativeRect = DesiredRect;
s32 w = RelativeRect.getWidth();
s32 h = RelativeRect.getHeight();
// make sure the desired rectangle is allowed
if (w < MinSize.Width)
RelativeRect.LowerRightCorner.X = RelativeRect.UpperLeftCorner.X + MinSize.Width;
if (h < MinSize.Height)
RelativeRect.LowerRightCorner.Y = RelativeRect.UpperLeftCorner.Y + MinSize.Height;
if (MaxSize.Width && w > MaxSize.Width)
RelativeRect.LowerRightCorner.X = RelativeRect.UpperLeftCorner.X + MaxSize.Width;
if (MaxSize.Height && h > MaxSize.Height)
RelativeRect.LowerRightCorner.Y = RelativeRect.UpperLeftCorner.Y + MaxSize.Height;
RelativeRect.repair();
AbsoluteRect = RelativeRect + parentAbsolute.UpperLeftCorner;
if (!Parent)
parentAbsoluteClip = AbsoluteRect;
AbsoluteClippingRect = AbsoluteRect;
AbsoluteClippingRect.clipAgainst(parentAbsoluteClip);
LastParentRect = parentAbsolute;
// update all children
core::list<IGUIElement*>::Iterator it = Children.begin();
for (; it != Children.end(); ++it)
{
(*it)->updateAbsolutePosition();
}
}
//! Returns the child element, which is at the position of the point.
IGUIElement* getElementFromPoint(const core::position2d<s32>& point)
{
IGUIElement* target = 0;
// we have to search from back to front.
core::list<IGUIElement*>::Iterator it = Children.getLast();
if (IsVisible)
while(it != Children.end())
{
target = (*it)->getElementFromPoint(point);
if (target)
return target;
--it;
}
if (AbsoluteClippingRect.isPointInside(point) && IsVisible)
target = this;
return target;
}
//! Adds a GUI element as new child of this element.
virtual void addChild(IGUIElement* child)
{
if (child)
{
child->grab();
child->remove(); // remove from old parent
child->Parent = this;
Children.push_back(child);
}
}
//! Removes a child.
virtual void removeChild(IGUIElement* child)
{
core::list<IGUIElement*>::Iterator it = Children.begin();
for (; it != Children.end(); ++it)
if ((*it) == child)
{
(*it)->Parent = 0;
(*it)->drop();
Children.erase(it);
return;
}
}
//! Removes this element from its parent.
virtual void remove()
{
if (Parent)
Parent->removeChild(this);
}
//! Draws the element and its children.
virtual void draw()
{
if (!IsVisible)
return;
core::list<IGUIElement*>::Iterator it = Children.begin();
for (; it != Children.end(); ++it)
(*it)->draw();
}
//! animate the element and its children.
virtual void OnPostRender(u32 timeMs)
{
if (!IsVisible)
return;
core::list<IGUIElement*>::Iterator it = Children.begin();
for (; it != Children.end(); ++it)
(*it)->OnPostRender( timeMs );
}
//! Moves this element.
virtual void move(core::position2d<s32> absoluteMovement)
{
setRelativePosition(DesiredRect + absoluteMovement);
}
//! Returns true if element is visible.
virtual bool isVisible()
{
_IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
return IsVisible;
}
//! Sets the visible state of this element.
virtual void setVisible(bool visible)
{
IsVisible = visible;
}
//! Returns true if this element was created as part of its parent control
virtual bool isSubElement()
{
_IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
return IsSubElement;
}
//! Sets whether this control was created as part of its parent,
//! for example when a scrollbar is part of a listbox.
//! SubElements are not saved to disk when calling guiEnvironment->saveGUI()
virtual void setSubElement(bool subElement)
{
IsSubElement = subElement;
}
//! Returns true if element is enabled.
virtual bool isEnabled()
{
_IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
return IsEnabled;
}
//! Sets the enabled state of this element.
virtual void setEnabled(bool enabled)
{
IsEnabled = enabled;
}
//! Sets the new caption of this element.
virtual void setText(const wchar_t* text)
{
Text = text;
}
//! Returns caption of this element.
virtual const wchar_t* getText()
{
return Text.c_str();
}
//! Sets the new caption of this element.
virtual void setToolTipText(const wchar_t* text)
{
ToolTipText = text;
}
//! Returns caption of this element.
virtual core::stringw &getToolTipText()
{
return ToolTipText;
}
//! Returns id. Can be used to identify the element.
virtual s32 getID()
{
return ID;
}
//! Sets the id of this element
virtual void setID(s32 id)
{
ID = id;
}
//! Called if an event happened.
virtual bool OnEvent(SEvent event)
{
if (Parent)
Parent->OnEvent(event);
return true;
}
//! Brings a child to front
/** \return Returns true if successful, false if not. */
virtual bool bringToFront(IGUIElement* element)
{
core::list<IGUIElement*>::Iterator it = Children.begin();
for (; it != Children.end(); ++it)
{
if (element == (*it))
{
Children.erase(it);
Children.push_back(element);
return true;
}
}
_IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
return false;
}
//! Returns list with children of this element
virtual const core::list<IGUIElement*>& getChildren() const
{
return Children;
}
//! Finds the first element with the given id.
/** \param id: Id to search for.
\param searchchildren: Set this to true, if also children of this
element may contain the element with the searched id and they
should be searched too.
\return Returns the first element with the given id. If no element
with this id was found, 0 is returned. */
virtual IGUIElement* getElementFromId(s32 id, bool searchchildren=false) const
{
IGUIElement* e = 0;
core::list<IGUIElement*>::Iterator it = Children.begin();
for (; it != Children.end(); ++it)
{
if ((*it)->getID() == id)
return (*it);
if (searchchildren)
e = (*it)->getElementFromId(id, true);
if (e)
return e;
}
return e;
}
//! Returns the type of the gui element.
/** This is needed for the .NET wrapper but will be used
later for serializing and deserializing.
If you wrote your own GUIElements, you need to set the type for your element as first parameter
in the constructor of IGUIElement. For own (=unknown) elements, simply use EGUIET_ELEMENT as type */
EGUI_ELEMENT_TYPE getType()
{
return Type;
}
//! Returns the type name of the gui element.
/** This is needed serializing elements. For serializing your own elements, override this function
and return your own type name which is created by your IGUIElementFactory */
virtual const c8* getTypeName()
{
return GUIElementTypeNames[Type];
}
//! Writes attributes of the scene node.
//! Implement this to expose the attributes of your scene node for
//! scripting languages, editors, debuggers or xml serialization purposes.
virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0)
{
out->addInt("Id", ID );
out->addString("Caption", Text.c_str());
out->addRect("Rect", DesiredRect);
out->addPosition2d("MinSize", core::position2di(MinSize.Width, MinSize.Height));
out->addPosition2d("MaxSize", core::position2di(MaxSize.Width, MaxSize.Height));
out->addBool("NoClip", NoClip);
out->addEnum("LeftAlign", AlignLeft, GUIAlignmentNames);
out->addEnum("RightAlign", AlignRight, GUIAlignmentNames);
out->addEnum("TopAlign", AlignTop, GUIAlignmentNames);
out->addEnum("BottomAlign", AlignBottom, GUIAlignmentNames);
out->addBool("Visible", IsVisible );
out->addBool("Enabled", IsEnabled );
}
//! Reads attributes of the scene node.
//! Implement this to set the attributes of your scene node for
//! scripting languages, editors, debuggers or xml deserialization purposes.
virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0)
{
//! relative rect of element
ID = in->getAttributeAsInt("Id");
Text = in->getAttributeAsStringW("Caption").c_str();
IsVisible = in->getAttributeAsBool("Visible");
IsEnabled = in->getAttributeAsBool("Enabled");
core::position2di p = in->getAttributeAsPosition2d("MaxSize");
MaxSize = core::dimension2di(p.X,p.Y);
p = in->getAttributeAsPosition2d("MinSize");
MinSize = core::dimension2di(p.X,p.Y);
NoClip = in->getAttributeAsBool("NoClip");
AlignLeft = (EGUI_ALIGNMENT) in->getAttributeAsEnumeration("LeftAlign", GUIAlignmentNames);
AlignRight = (EGUI_ALIGNMENT)in->getAttributeAsEnumeration("RightAlign", GUIAlignmentNames);
AlignTop = (EGUI_ALIGNMENT)in->getAttributeAsEnumeration("TopAlign", GUIAlignmentNames);
AlignBottom = (EGUI_ALIGNMENT)in->getAttributeAsEnumeration("BottomAlign", GUIAlignmentNames);
setRelativePosition(in->getAttributeAsRect("Rect"));
}
protected:
//! List of all children of this element
core::list<IGUIElement*> Children;
//! Pointer to the parent
IGUIElement* Parent;
//! relative rect of element
core::rect<s32> RelativeRect;
//! absolute rect of element
core::rect<s32> AbsoluteRect;
//! absolute clipping rect of element
core::rect<s32> AbsoluteClippingRect;
//! the rectangle the element would prefer to be,
//! if it was not constrained by parent or max/min size
core::rect<s32> DesiredRect;
//! for calculating the difference when resizing parent
core::rect<s32> LastParentRect;
//! relative scale of the element inside its parent
core::rect<f32> ScaleRect;
//! maximum and minimum size of the element
core::dimension2di MaxSize, MinSize;
//! is visible?
bool IsVisible;
//! is enabled?
bool IsEnabled;
//! is a part of a larger whole and should not be serialized?
bool IsSubElement;
//! does this element ignore its parent's clipping rectangle?
bool NoClip;
//! caption
core::stringw Text;
//! tooltip
core::stringw ToolTipText;
//! id
s32 ID;
//! tells the element how to act when its parent is resized
EGUI_ALIGNMENT AlignLeft, AlignRight, AlignTop, AlignBottom;
//! GUI Environment
IGUIEnvironment* Environment;
//! type of element
EGUI_ELEMENT_TYPE Type;
};
} // end namespace gui
} // end namespace irr
#endif

View File

@ -0,0 +1,66 @@
// Copyright (C) 2002-2006 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_GUI_ELEMENT_FACTORY_H_INCLUDED__
#define __I_GUI_ELEMENT_FACTORY_H_INCLUDED__
#include "IUnknown.h"
#include "EGUIElementTypes.h"
namespace irr
{
namespace gui
{
class IGUIElement;
//! Interface making it possible to dynamicly create GUI elements
/** To be able to add custom elements to Irrlicht and to make it possible for the
scene manager to save and load them, simply implement this interface and register it
in your gui environment via IGUIEnvironment::registerGUIElementFactory.
Note: When implementing your own element factory, don't call IGUIEnvironment::grab() to
increase the reference counter of the environment. This is not necessary because the
it will grab() the factory anyway, and otherwise cyclic references will be created.
*/
class IGUIElementFactory : public virtual IUnknown
{
public:
//! adds an element to the gui environment based on its type id
/** \param type: Type of the element to add.
\param parent: Parent scene node of the new element, can be null to add to the root.
\return Returns pointer to the new element or null if not successful. */
virtual IGUIElement* addGUIElement(EGUI_ELEMENT_TYPE type, IGUIElement* parent=0) = 0;
//! adds a GUI element to the GUI Environment based on its type name
/** \param typeName: Type name of the element to add.
\param parent: Parent scene node of the new element, can be null to add it to the root.
\return Returns pointer to the new element or null if not successful. */
virtual IGUIElement* addGUIElement(const c8* typeName, IGUIElement* parent=0) = 0;
//! returns amount of GUI element types this factory is able to create
virtual s32 getCreatableGUIElementTypeCount() = 0;
//! returns type of a createable element type
/** \param idx: Index of the element type in this factory. Must be a value between 0 and
getCreatableGUIElementTypeCount() */
virtual EGUI_ELEMENT_TYPE getCreateableGUIElementType(s32 idx) = 0;
//! returns type name of a createable GUI element type by index
/** \param idx: Index of the type in this factory. Must be a value between 0 and
getCreatableGUIElementTypeCount() */
virtual const c8* getCreateableGUIElementTypeName(s32 idx) = 0;
//! returns type name of a createable GUI element
/** \param type: Type of GUI element.
\return: Returns name of the type if this factory can create the type, otherwise 0. */
virtual const c8* getCreateableGUIElementTypeName(EGUI_ELEMENT_TYPE type) = 0;
};
} // end namespace gui
} // end namespace irr
#endif // __I_GUI_ELEMENT_FACTORY_H_INCLUDED__

View File

@ -0,0 +1,395 @@
// Copyright (C) 2002-2007 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_GUI_ENVIRNMENT_H_INCLUDED__
#define __I_GUI_ENVIRNMENT_H_INCLUDED__
#include "rect.h"
#include "IUnknown.h"
#include "IEventReceiver.h"
#include "irrTypes.h"
#include "IGUIWindow.h"
#include "IGUISkin.h"
#include "IFileSystem.h"
namespace irr
{
namespace io
{
class IXMLWriter;
class IReadFile;
class IWriteFile;
} // end namespace io
namespace video
{
class IVideoDriver;
class ITexture;
} // end namespace video
namespace gui
{
class IGUIElement;
class IGUIFont;
class IGUISpriteBank;
class IGUIScrollBar;
class IGUIImage;
class IGUIMeshViewer;
class IGUICheckBox;
class IGUIListBox;
class IGUIFileOpenDialog;
class IGUIColorSelectDialog;
class IGUIInOutFader;
class IGUIStaticText;
class IGUIEditBox;
class IGUITabControl;
class IGUITab;
class IGUIContextMenu;
class IGUIComboBox;
class IGUIToolBar;
class IGUIElementFactory;
//! GUI Environment. Used as factory and manager of all other GUI elements.
class IGUIEnvironment : public virtual IUnknown
{
public:
//! destructor
virtual ~IGUIEnvironment() {};
//! Draws all gui elements.
virtual void drawAll() = 0;
//! Sets the focus to an element.
virtual void setFocus(IGUIElement* element) = 0;
//! Returns the element with the focus
virtual IGUIElement* getFocus() = 0;
//! Removes the focus from an element.
virtual void removeFocus(IGUIElement* element) = 0;
//! Returns if the element has focus
virtual bool hasFocus(IGUIElement* element) = 0;
//! Returns the current video driver.
virtual video::IVideoDriver* getVideoDriver() = 0;
//! Returns the file system.
virtual io::IFileSystem* getFileSystem() = 0;
//! removes all elements from the environment.
virtual void clear() = 0;
//! Posts an input event to the environment.
/** Usually you do not have to
use this method, it is used by the internal engine. */
virtual bool postEventFromUser(SEvent event) = 0;
//! This sets a new event receiver for gui events.
/** Usually you do not have to
use this method, it is used by the internal engine. */
virtual void setUserEventReceiver(IEventReceiver* evr) = 0;
//! Returns pointer to the current gui skin.
virtual IGUISkin* getSkin() = 0;
//! Sets a new GUI Skin
/** You can used this to change the appearance of the whole GUI Environment. You
can set one ot the built-in skins or implement your own class derived from
IGUISkin and set this useing this method.
To set for example the built-in Windows classic skin, use the following code:
\code
gui::IGUISkin* newskin = environment->createSkin(gui::EGST_WINDOWS_CLASSIC);
environment->setSkin(newskin);
newskin->drop();
\endcode
*/
virtual void setSkin(IGUISkin* skin) = 0;
//! Creates a new GUI Skin based on a template.
/** Use setSkin() to set the created skin.
\return Returns a pointer to the created skin.
If you no longer need the image, you should call IGUISkin::drop().
See IUnknown::drop() for more information. */
virtual IGUISkin* createSkin(EGUI_SKIN_TYPE type) = 0;
//! Returns pointer to the font with the specified file name.
/** Loads the font if it was not loaded before. Returns 0 if the font could not be loaded.
\return
returns a pointer to the font.
This pointer should not be dropped. See IUnknown::drop() for more information. */
virtual IGUIFont* getFont(const c8* filename) = 0;
//! Returns the default built-in font.
virtual IGUIFont* getBuiltInFont() = 0;
//! Returns pointer to the sprite bank with the specified file name.
/** Loads the bank if it was not loaded before. Returns 0 if it could not be loaded.
\return
returns a pointer to the sprite bank.
This pointer should not be dropped. See IUnknown::drop() for more information. */
virtual IGUISpriteBank* getSpriteBank(const c8* filename) = 0;
//! adds an empty sprite bank to the manager
virtual IGUISpriteBank* addEmptySpriteBank(const c8 *name) = 0;
//! Returns the root gui element.
/** This is the first gui element, parent of all other
gui elements. You'll never need to use this method, unless you are not creating
your own gui elements, trying to add them to the gui elements without a parent.
The returned pointer should not be dropped. See IUnknown::drop() for more information. */
virtual IGUIElement* getRootGUIElement() = 0;
//! Adds an button element.
/** \return
Returns a pointer to the created button. Returns 0 if an error occured.
This pointer should not be dropped. See IUnknown::drop() for more information. */
virtual IGUIButton* addButton(const core::rect<s32>& rectangle,
IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0, const wchar_t* tooltiptext = 0) = 0;
//! Adds an empty window element.
/** \param modal: Defines if the dialog is modal. This means, that all other
gui elements which were created before the message box cannot be used
until this messagebox is removed.
\return
Returns a pointer to the created window. Returns 0 if an error occured.
This pointer should not be dropped. See IUnknown::drop() for more information. */
virtual IGUIWindow* addWindow(const core::rect<s32>& rectangle, bool modal = false,
const wchar_t* text=0, IGUIElement* parent=0, s32 id=-1) = 0;
//! Adds a modal screen. This control stops its parent's members from being
//! able to recieve input until its last child is removed, it then deletes its self.
/** \return
Returns a pointer to the created window. Returns 0 if an error occured.
This pointer should not be dropped. See IUnknown::drop() for more information. */
virtual IGUIElement* addModalScreen(IGUIElement* parent) = 0;
//! Adds a message box.
/** \param caption: Text to be displayed the title of the message box.
\param text: Text to be displayed in the body of the message box.
\param modal: Defines if the dialog is modal. This means, that all other
gui elements which were created before the message box cannot be used
until this messagebox is removed.
\param flags: Flags specifying the layout of the message box. For example
to create a message box with an OK and a CANCEL button on it, set this
to (EMBF_OK | EMBF_CANCEL).
\param parent: Parent gui element of the message box.
\param id: Id with which the gui element can be identified.
\return
Returns a pointer to the created message box. Returns 0 if an error occured.
This pointer should not be dropped. See IUnknown::drop() for more information. */
virtual IGUIWindow* addMessageBox(const wchar_t* caption, const wchar_t* text=0,
bool modal = true, s32 flags = EMBF_OK, IGUIElement* parent=0, s32 id=-1) = 0;
//! Adds a scrollbar.
/** \return
Returns a pointer to the created scrollbar. Returns 0 if an error occured.
This pointer should not be dropped. See IUnknown::drop() for more information. */
virtual IGUIScrollBar* addScrollBar(bool horizontal, const core::rect<s32>& rectangle,
IGUIElement* parent=0, s32 id=-1) = 0;
//! Adds an image element.
/** \param image: Image to be displayed.
\param pos: Position of the image. The width and height of the image is taken
from the image.
\param useAlphaChannel: Sets if the image should use the alpha channel of the texture
to draw itself.
\return
Returns a pointer to the created image element. Returns 0 if an error occured.
This pointer should not be dropped. See IUnknown::drop() for more information. */
virtual IGUIImage* addImage(video::ITexture* image, core::position2d<s32> pos,
bool useAlphaChannel=true, IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0) = 0;
//! Adds an image element.
/** Use IGUIImage::setImage later to set the image to be displayed.
\return
Returns a pointer to the created image element. Returns 0 if an error occured.
This pointer should not be dropped. See IUnknown::drop() for more information. */
virtual IGUIImage* addImage(const core::rect<s32>& rectangle,
IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0) = 0;
//! Adds a checkbox element.
/** \return
Returns a pointer to the created check box. Returns 0 if an error occured.
This pointer should not be dropped. See IUnknown::drop() for more information. */
virtual IGUICheckBox* addCheckBox(bool checked, const core::rect<s32>& rectangle,
IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0) = 0;
//! Adds a list box element.
/** \return
Returns a pointer to the created list box. Returns 0 if an error occured.
This pointer should not be dropped. See IUnknown::drop() for more information. */
virtual IGUIListBox* addListBox(const core::rect<s32>& rectangle,
IGUIElement* parent=0, s32 id=-1, bool drawBackground=false) = 0;
//! Adds an mesh viewer. Not 100% implemented yet.
/** \return
Returns a pointer to the created mesh viewer. Returns 0 if an error occured.
This pointer should not be dropped. See IUnknown::drop() for more information. */
virtual IGUIMeshViewer* addMeshViewer(const core::rect<s32>& rectangle, IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0) = 0;
//! Adds a file open dialog.
/** \param modal: Defines if the dialog is modal. This means, that all other
gui elements which were created before the message box cannot be used
until this messagebox is removed.
\return
Returns a pointer to the created file open dialog. Returns 0 if an error occured.
This pointer should not be dropped. See IUnknown::drop() for more information. */
virtual IGUIFileOpenDialog* addFileOpenDialog(const wchar_t* title = 0,
bool modal=true, IGUIElement* parent=0, s32 id=-1) = 0;
//! Adds a color select dialog.
/** \param modal: Defines if the dialog is modal. This means, that all other
gui elements which were created before the message box cannot be used
until this messagebox is removed.
\return
Returns a pointer to the created file open dialog. Returns 0 if an error occured.
This pointer should not be dropped. See IUnknown::drop() for more information. */
virtual IGUIColorSelectDialog* addColorSelectDialog(const wchar_t* title = 0,
bool modal=true, IGUIElement* parent=0, s32 id=-1) = 0;
//! Adds a static text.
/** The returned pointer must not be dropped.
\param text is the text to be displayed. Can be altered after creation with SetText().
\param rectangle is the position of the static text.
\param border has to be set to true if the static text should have a 3d border.
\param wordWrap specifies, if the text should be wrapped into multiple lines.
\param parent is the parent item of the element. E.g. a window. Set it to 0 to place the fader directly in the environment.
\param id is a s32 to identify the static text element.
\param fillBackground specifies if the background will be filled. Default: false.
\return
Returns a pointer to the created static text. Returns 0 if an error occured.
This pointer should not be dropped. See IUnknown::drop() for more information. */
virtual IGUIStaticText* addStaticText(const wchar_t* text, const core::rect<s32>& rectangle,
bool border=false, bool wordWrap=true, IGUIElement* parent=0, s32 id=-1,
bool fillBackground = false) = 0;
//! Adds an edit box.
/** Supports unicode input from every keyboard around the world,
scrolling, copying and pasting (exchanging data with the clipboard directly), maximum
character amount, marking and all shortcuts like ctrl+X, ctrl+V, ctrg+C,
shift+Left, shift+Right, Home, End, and so on.
\param text is the text to be displayed. Can be altered after creation with SetText().
\param rectangle is the position of the edit box.
\param border has to be set to true if the edit box should have a 3d border.
\param parent is the parent item of the element. E.g. a window. Set it to 0 to place the edit box directly in the environment.
\param id is a s32 to identify the edit box.
\return
Returns a pointer to the created static text. Returns 0 if an error occured.
This pointer should not be dropped. See IUnknown::drop() for more information. */
virtual IGUIEditBox* addEditBox(const wchar_t* text, const core::rect<s32>& rectangle,
bool border=true, IGUIElement* parent=0, s32 id=-1) = 0;
//! Adds an element for fading in or out.
/* \param rectangle: Pointer to rectangle specifing the borders of the element.
If the pointer is NULL, the whole screen is used.
\param parent: Parent item of the element. E.g. a window. Set it to 0 to place the static text directly in the environment.
\param id: A s32 to identify the text.
\return
Returns a pointer to the created in-out-fader. Returns 0 if an error occured.
This pointer should not be dropped. See IUnknown::drop() for more information. */
virtual IGUIInOutFader* addInOutFader(const core::rect<s32>* rectangle=0, IGUIElement* parent=0, s32 id=-1) = 0;
//! Adds a tab control to the environment.
/** \param rectangle is the position of the tab control.
\param parent is the parent item of the element. E.g. a window. Set it to 0 to place the tab control directly in the environment.
\param fillbackground specifies if the background of the tab control should be drawn to.
\param border specifiys if a flat 3d border should be drawn.
This is usually not necesarry unless you don't place the control directly into the environment without a window as parent.
\param id is a s32 to identify the tab control.
\return
Returns a pointer to the created tab control element. Returns 0 if an error occured.
This pointer should not be dropped. See IUnknown::drop() for more information. */
virtual IGUITabControl* addTabControl(const core::rect<s32>& rectangle,
IGUIElement* parent=0, bool fillbackground=false,
bool border=true, s32 id=-1) = 0;
//! Adds tab to the environment.
/** You can use this element to group other elements. This is not used for creating tabs on tab controls,
please use IGUITabControl::addTab() for this instead.
\param rectangle is the position of the tab.
\param parent is the parent item of the element. E.g. a window. Set it to 0 to place the tab directly in the environment.
\param id is a s32 to identify the tab. */
virtual IGUITab* addTab(const core::rect<s32>& rectangle,
IGUIElement* parent=0, s32 id=-1) = 0;
//! Adds a context menu to the environment.
/** \param rectangle is the position of the menu. Note that the menu is
resizing itself based on what items you add.
\param parent is the parent item of the element. E.g. a window. Set it to 0 to place the menu directly in the environment.
\param id is a s32 to identify the menu. */
virtual IGUIContextMenu* addContextMenu(const core::rect<s32>& rectangle,
IGUIElement* parent=0, s32 id=-1) = 0;
//! Adds a menu to the environment.
/* This is like the menu you can find on top of most windows in modern graphical user interfaces.
\param parent is the parent item of the element. E.g. a window. Set it to 0 to place the menu directly in the environment.
\param id is a s32 to identify the menu. */
virtual IGUIContextMenu* addMenu(IGUIElement* parent=0, s32 id=-1) = 0;
//! Adds a toolbar to the environment.
/** It is like a menu is always placed on top
in its parent, and contains buttons.
\param parent is the parent item of the element. E.g. a window. Set it to 0 to place the tool bar directly in the environment.
\param id is a s32 to identify the tool bar. */
virtual IGUIToolBar* addToolBar(IGUIElement* parent=0, s32 id=-1) = 0;
//! Adds a combo box to the environment.
/** \param parent is the parent item of the element. E.g. a window. Set it to 0 to place the combo box directly in the environment.
\param id is a s32 to identify the combo box. */
virtual IGUIComboBox* addComboBox(const core::rect<s32>& rectangle,
IGUIElement* parent=0, s32 id=-1) = 0;
//! Returns the default element factory which can create all built in elements
virtual IGUIElementFactory* getDefaultGUIElementFactory() = 0;
//! Adds an element factory to the gui environment.
/** Use this to extend the gui environment with new element types which it should be
able to create automaticly, for example when loading data from xml files. */
virtual void registerGUIElementFactory(IGUIElementFactory* factoryToAdd) = 0;
//! Returns amount of registered scene node factories.
virtual s32 getRegisteredGUIElementFactoryCount() = 0;
//! Returns a scene node factory by index
virtual IGUIElementFactory* getGUIElementFactory(s32 index) = 0;
//! Adds a GUI Element by its name
virtual IGUIElement* addGUIElement(const c8* elementName, IGUIElement* parent=0) = 0;
//! Saves the current gui into a file.
//! \param filename: Name of the file.
virtual bool saveGUI(const c8* filename)=0;
//! Saves the current gui into a file.
virtual bool saveGUI(io::IWriteFile* file)=0;
//! Loads the gui. Note that the current gui is not cleared before.
//! \param filename: Name of the file .
virtual bool loadGUI(const c8* filename)=0;
//! Loads the gui. Note that the current gui is not cleared before.
virtual bool loadGUI(io::IReadFile* file)=0;
//! Writes attributes of the gui environment
virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0)=0;
//! Reads attributes of the gui environment
virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0)=0;
//! writes an element
virtual void writeGUIElement(io::IXMLWriter* writer, IGUIElement* node) =0;
//! reads an element
virtual void readGUIElement(io::IXMLReader* reader, IGUIElement* parent) =0;
};
} // end namespace gui
} // end namespace irr
#endif

View File

@ -0,0 +1,37 @@
// Copyright (C) 2002-2007 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_GUI_FILE_OPEN_DIALOG_H_INCLUDED__
#define __I_GUI_FILE_OPEN_DIALOG_H_INCLUDED__
#include "IGUIElement.h"
namespace irr
{
namespace gui
{
//! Standard file chooser dialog.
class IGUIFileOpenDialog : public IGUIElement
{
public:
//! constructor
IGUIFileOpenDialog(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
: IGUIElement(EGUIET_FILE_OPEN_DIALOG, environment, parent, id, rectangle) {}
//! destructor
virtual ~IGUIFileOpenDialog() {};
//! Returns the filename of the selected file. Returns NULL, if no file was selected.
virtual const wchar_t* getFilename() = 0;
};
} // end namespace gui
} // end namespace irr
#endif

View File

@ -0,0 +1,99 @@
// Copyright (C) 2002-2007 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_GUI_FONT_H_INCLUDED__
#define __I_GUI_FONT_H_INCLUDED__
#include "IUnknown.h"
#include "rect.h"
#include "irrTypes.h"
#include "SColor.h"
#include "irrArray.h"
#include "ITexture.h"
namespace irr
{
namespace gui
{
//! An enum for the different types of GUI font.
enum EGUI_FONT_TYPE
{
//! Bitmap fonts loaded from an XML file or a texture.
EGFT_BITMAP = 0,
//! Scalable vector fonts loaded from an XML file.
//! These fonts reside in system memory and use no video memory
//! until they are displayed. These are slower than bitmap fonts
//! but can be easily scaled and rotated.
EGFT_VECTOR,
//! A font which uses a the native API provided by the operating system.
//! Currently not used.
EGFT_OS,
//! An external font type provided by the user.
EGFT_CUSTOM
};
//! Font interface.
class IGUIFont : public virtual IUnknown
{
public:
//! Destructor
virtual ~IGUIFont() {};
//! Draws an text and clips it to the specified rectangle if wanted.
/** \param text: Text to draw
\param position: Rectangle specifying position where to draw the text.
\param color: Color of the text
\param hcenter: Specifiies if the text should be centered horizontally into the rectangle.
\param vcenter: Specifiies if the text should be centered vertically into the rectangle.
\param clip: Optional pointer to a rectangle against which the text will be clipped.
If the pointer is null, no clipping will be done. */
virtual void draw(const wchar_t* text, const core::rect<s32>& position,
video::SColor color, bool hcenter=false, bool vcenter=false,
const core::rect<s32>* clip=0) = 0;
//! Calculates the dimension of a text.
/** \return Returns width and height of the area covered by the text if it would be
drawn. */
virtual core::dimension2d<s32> getDimension(const wchar_t* text) = 0;
//! Calculates the index of the character in the text which is on a specific position.
/** \param text: Text string.
\param pixel_x: X pixel position of which the index of the character will be returned.
\return Returns zero based index of the character in the text, and -1 if no no character
is on this position. (=the text is too short). */
virtual s32 getCharacterFromPos(const wchar_t* text, s32 pixel_x) = 0;
//! Returns the type of this font
virtual EGUI_FONT_TYPE getType() { return EGFT_CUSTOM; }
//! Sets global kerning for the font.
virtual void setKerningWidth (s32 kerning) = 0;
virtual void setKerningHeight (s32 kerning) = 0;
//! Gets kerning values (distance between letters) for the font. If no parameters are provided,
/** the global kerning distance is returned.
\param thisLetter: If this parameter is provided, the left side kerning for this letter is added
to the global kerning value. For example, a space might only be one pixel wide, but it may
be displayed as several pixels.
\param previousLetter: If provided, kerning is calculated for both letters and added to the global
kerning value. For example, in a font which supports kerning pairs a string such as 'Wo' may have
the 'o' tucked neatly under the 'W'.
*/
virtual s32 getKerningWidth(const wchar_t* thisLetter=0, const wchar_t* previousLetter=0) = 0;
//! Returns the distance between letters
virtual s32 getKerningHeight() = 0;
};
} // end namespace gui
} // end namespace irr
#endif

View File

@ -0,0 +1,50 @@
// Copyright (C) 2002-2006 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_GUI_FONT_BITMAP_H_INCLUDED__
#define __I_GUI_FONT_BITMAP_H_INCLUDED__
#include "IGUIFont.h"
#include "IGUISpriteBank.h"
namespace irr
{
namespace gui
{
//! Font interface.
class IGUIFontBitmap : public IGUIFont
{
public:
//! Destructor
virtual ~IGUIFontBitmap() {};
//! Returns the type of this font
virtual EGUI_FONT_TYPE getType() { return EGFT_BITMAP; }
//! returns the parsed Symbol Information
virtual IGUISpriteBank* getSpriteBank() = 0;
//! returns the sprite number from a given character
virtual u32 getSpriteNoFromChar(const wchar_t *c) = 0;
//! Gets kerning values (distance between letters) for the font. If no parameters are provided,
/** the global kerning distance is returned.
\param thisLetter: If this parameter is provided, the left side kerning for this letter is added
to the global kerning value. For example, a space might only be one pixel wide, but it may
be displayed as several pixels.
\param previousLetter: If provided, kerning is calculated for both letters and added to the global
kerning value. For example, EGFT_BITMAP will add the right kerning value of previousLetter to the
left side kerning value of thisLetter, then add the global value.
*/
virtual s32 getKerningWidth(const wchar_t* thisLetter=0, const wchar_t* previousLetter=0) = 0;
};
} // end namespace gui
} // end namespace irr
#endif

View File

@ -0,0 +1,40 @@
// Copyright (C) 2002-2007 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_GUI_IMAGE_H_INCLUDED__
#define __I_GUI_IMAGE_H_INCLUDED__
#include "IGUIElement.h"
#include "ITexture.h"
namespace irr
{
namespace gui
{
//! GUI element displaying an image.
class IGUIImage : public IGUIElement
{
public:
//! constructor
IGUIImage(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
: IGUIElement(EGUIET_IMAGE, environment, parent, id, rectangle) {}
//! destructor
~IGUIImage() {};
//! sets an image
virtual void setImage(video::ITexture* image) = 0;
//! sets if the image should use its alpha channel to draw itself
virtual void setUseAlphaChannel(bool use) = 0;
};
} // end namespace gui
} // end namespace irr
#endif

View File

@ -0,0 +1,69 @@
// Copyright (C) 2002-2007 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_GUI_IN_OUT_FADER_H_INCLUDED__
#define __I_GUI_IN_OUT_FADER_H_INCLUDED__
#include "IGUIElement.h"
#include "SColor.h"
namespace irr
{
namespace gui
{
//! Element for fading out or in
/** Here is a small example on how the class is used. In this example we fade
in from a total red screen in the beginning. As you can see, the fader is not
only useful for dramatic in and out fading, but also to show that the player
is hit in a first person shooter game for example.
\code
gui::IGUIInOutFader* fader = device->getGUIEnvironment()->addInOutFader();
fader->setColor(video::SColor(0,255,0,0));
fader->fadeIn(4000);
\endcode
*/
class IGUIInOutFader : public IGUIElement
{
public:
//! constructor
IGUIInOutFader(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
: IGUIElement(EGUIET_IN_OUT_FADER, environment, parent, id, rectangle) {}
//! destructor
~IGUIInOutFader() {};
//! Gets the color to fade out to or to fade in from.
virtual video::SColor getColor() const = 0;
//! Sets the color to fade out to or to fade in from.
//! \param color: Color to where it is faded out od from it is faded in.
virtual void setColor(video::SColor color) = 0;
virtual void setColor(video::SColor source, video::SColor dest) = 0;
//! Starts the fade in process. In the beginning the whole rect is drawn by
//! the set color (black by default) and at the end of the overgiven
//! time the color has faded out.
//! \param time: Time specifing how long it should need to fade in,
//! in milliseconds.
virtual void fadeIn(u32 time) = 0;
//! Starts the fade out process. In the beginning everything is visible,
//! and at the end of the time only the set color (black by the fault)
//! will be drawn.
//! \param time: Time specifing how long it should need to fade out,
//! in milliseconds.
virtual void fadeOut(u32 time) = 0;
//! Returns if the fade in or out process is done.
virtual bool isReady() const = 0;
};
} // end namespace gui
} // end namespace irr
#endif

View File

@ -0,0 +1,70 @@
// Copyright (C) 2002-2007 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_GUI_LIST_BOX_BAR_H_INCLUDED__
#define __I_GUI_LIST_BOX_BAR_H_INCLUDED__
#include "IGUIElement.h"
#include "irrTypes.h"
namespace irr
{
namespace gui
{
class IGUIFont;
class IGUISpriteBank;
//! Default list box GUI element.
class IGUIListBox : public IGUIElement
{
public:
//! constructor
IGUIListBox(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
: IGUIElement(EGUIET_LIST_BOX, environment, parent, id, rectangle) {}
//! destructor
~IGUIListBox() {};
//! returns amount of list items
virtual s32 getItemCount() = 0;
//! returns string of a list item. the may id be a value from 0 to itemCount-1
virtual const wchar_t* getListItem(s32 id) = 0;
//! adds an list item, returns id of item
virtual s32 addItem(const wchar_t* text) = 0;
//! adds an list item with an icon
//! \param text Text of list entry
//! \param icon Sprite index of the Icon within the current sprite bank. Set it to -1 if you want no icon
//! \return
//! returns the id of the new created item
virtual s32 addItem(const wchar_t* text, s32 icon) = 0;
//! Removes an item from the list
virtual void removeItem(s32 index) = 0;
//! Sets the sprite bank which should be used to draw list icons. This font is set to the sprite bank of
//! the built-in-font by default. A sprite can be displayed in front of every list item.
//! An icon is an index within the icon sprite bank. Several default icons are available in the
//! skin through getIcon
virtual void setSpriteBank(IGUISpriteBank* bank) = 0;
//! clears the list, deletes all items in the listbox
virtual void clear() = 0;
//! returns id of selected item. returns -1 if no item is selected.
virtual s32 getSelected() = 0;
//! sets the selected item. Set this to -1 if no item should be selected
virtual void setSelected(s32 id) = 0;
};
} // end namespace gui
} // end namespace irr
#endif

View File

@ -0,0 +1,54 @@
// Copyright (C) 2002-2007 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_GUI_MESH_VIEWER_H_INCLUDED__
#define __I_GUI_MESH_VIEWER_H_INCLUDED__
#include "IGUIElement.h"
namespace irr
{
namespace video
{
class SMaterial;
} // end namespace video
namespace scene
{
class IAnimatedMesh;
} // end namespace scene
namespace gui
{
//! 3d mesh viewing GUI element.
class IGUIMeshViewer : public IGUIElement
{
public:
//! constructor
IGUIMeshViewer(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
: IGUIElement(EGUIET_MESH_VIEWER, environment, parent, id, rectangle) {}
//! destructor
~IGUIMeshViewer() {};
//! sets the mesh to be shown
virtual void setMesh(scene::IAnimatedMesh* mesh) = 0;
//! sets the material
virtual void setMaterial(const video::SMaterial& material) = 0;
//! gets the material
virtual const video::SMaterial& getMaterial() = 0;
};
} // end namespace gui
} // end namespace irr
#endif

View File

@ -0,0 +1,45 @@
// Copyright (C) 2002-2007 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_GUI_SCROLL_BAR_H_INCLUDED__
#define __I_GUI_SCROLL_BAR_H_INCLUDED__
#include "IGUIElement.h"
namespace irr
{
namespace gui
{
//! Default scroll bar GUI element.
class IGUIScrollBar : public IGUIElement
{
public:
//! constructor
IGUIScrollBar(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
: IGUIElement(EGUIET_SCROLL_BAR, environment, parent, id, rectangle) {}
//! destructor
~IGUIScrollBar() {};
//! sets the maximum value of the scrollbar. must be > 0
virtual void setMax(s32 max) = 0;
//! sets the small step value
virtual void setSmallStep(s32 step) = 0;
//! gets the current position of the scrollbar
virtual s32 getPos() = 0;
//! sets the current position of the scrollbar
virtual void setPos(s32 pos) = 0;
};
} // end namespace gui
} // end namespace irr
#endif

View File

@ -0,0 +1,453 @@
// Copyright (C) 2002-2007 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_GUI_SKIN_H_INCLUDED__
#define __I_GUI_SKIN_H_INCLUDED__
#include "IAttributeExchangingObject.h"
#include "SColor.h"
#include "IGUISkin.h"
#include "rect.h"
namespace irr
{
namespace gui
{
class IGUIFont;
class IGUISpriteBank;
class IGUIElement;
//! Enumeration of available default skins.
/** To set one of the skins, use the following code, for example to set
the Windows classic skin:
\code
gui::IGUISkin* newskin = environment->createSkin(gui::EGST_WINDOWS_CLASSIC);
environment->setSkin(newskin);
newskin->drop();
\endcode
*/
enum EGUI_SKIN_TYPE
{
//! Default windows look and feel
EGST_WINDOWS_CLASSIC=0,
//! Like EGST_WINDOWS_CLASSIC, but with metallic shaded windows and buttons
EGST_WINDOWS_METALLIC,
//! Burning's skin
EGST_BURNING_SKIN,
//! An unknown skin, not serializable at present
EGST_UNKNOWN
};
//! Names for gui element types
const c8* const GUISkinTypeNames[] =
{
"windowsClassic",
"windowsMetallic",
"burning",
"unknown",
0,
};
//! Enumeration for skin colors
enum EGUI_DEFAULT_COLOR
{
//! Dark shadow for three-dimensional display elements.
EGDC_3D_DARK_SHADOW = 0,
//! Shadow color for three-dimensional display elements (for edges facing away from the light source).
EGDC_3D_SHADOW,
//! Face color for three-dimensional display elements and for dialog box backgrounds.
EGDC_3D_FACE,
//! Highlight color for three-dimensional display elements (for edges facing the light source.)
EGDC_3D_HIGH_LIGHT,
//! Light color for three-dimensional display elements (for edges facing the light source.)
EGDC_3D_LIGHT,
//! Active window border.
EGDC_ACTIVE_BORDER,
//! Active window title bar text.
EGDC_ACTIVE_CAPTION,
//! Background color of multiple document interface (MDI) applications.
EGDC_APP_WORKSPACE,
//! Text on a button
EGDC_BUTTON_TEXT,
//! Grayed (disabled) text.
EGDC_GRAY_TEXT,
//! Item(s) selected in a control.
EGDC_HIGH_LIGHT,
//! Text of item(s) selected in a control.
EGDC_HIGH_LIGHT_TEXT,
//! Inactive window border.
EGDC_INACTIVE_BORDER,
//! Inactive window caption.
EGDC_INACTIVE_CAPTION,
//! Tool tip color
EGDC_TOOLTIP,
//! Scrollbar gray area
EGDC_SCROLLBAR,
//! Window background
EGDC_WINDOW,
//! Window symbols like on close buttons, scroll bars and check boxes
EGDC_WINDOW_SYMBOL,
//! Icons in a list or tree
EGDC_ICON,
//! Selected icons in a list or tree
EGDC_ICON_HIGH_LIGHT,
//! this value is not used, it only specifies the amount of default colors
//! available.
EGDC_COUNT
};
//! Names for default skin colors
const c8* const GUISkinColorNames[] =
{
"3DDarkShadow",
"3DShadow",
"3DFace",
"3DHighlight",
"3DLight",
"ActiveBorder",
"ActiveCaption",
"AppWorkspace",
"ButtonText",
"GrayText",
"Highlight",
"HighlightText",
"InactiveBorder",
"InactiveCaption",
"ToolTip",
"ScrollBar",
"Window",
"WindowSymbol",
"Icon",
"IconHighlight",
0,
};
//! Enumeration for default sizes.
enum EGUI_DEFAULT_SIZE
{
//! default with / height of scrollbar
EGDS_SCROLLBAR_SIZE = 0,
//! height of menu
EGDS_MENU_HEIGHT,
//! width of a window button
EGDS_WINDOW_BUTTON_WIDTH,
//! width of a checkbox check
EGDS_CHECK_BOX_WIDTH,
//! width of a messagebox
EGDS_MESSAGE_BOX_WIDTH,
//! height of a messagebox
EGDS_MESSAGE_BOX_HEIGHT,
//! width of a default button
EGDS_BUTTON_WIDTH,
//! height of a default button
EGDS_BUTTON_HEIGHT,
//! distance for text from background
EGDS_TEXT_DISTANCE_X,
//! distance for text from background
EGDS_TEXT_DISTANCE_Y,
//! this value is not used, it only specifies the amount of default sizes
//! available.
EGDS_COUNT
};
//! Names for default skin sizes
const c8* const GUISkinSizeNames[] =
{
"ScrollBarSize",
"MenuHeight",
"WindowButtonWidth",
"CheckBoxWidth",
"MessageBoxWidth",
"MessageBoxHeight",
"ButtonWidth",
"ButtonHeight",
"TextDistanceX",
"TextDistanceY",
0,
};
enum EGUI_DEFAULT_TEXT
{
//! Text for the OK button on a message box
EGDT_MSG_BOX_OK = 0,
//! Text for the Cancel button on a message box
EGDT_MSG_BOX_CANCEL,
//! Text for the Yes button on a message box
EGDT_MSG_BOX_YES,
//! Text for the No button on a message box
EGDT_MSG_BOX_NO,
//! Tooltip text for window close button
EGDT_WINDOW_CLOSE,
//! Tooltip text for window maximize button
EGDT_WINDOW_MAXIMIZE,
//! Tooltip text for window minimize button
EGDT_WINDOW_MINIMIZE,
//! Tooltip text for window restore button
EGDT_WINDOW_RESTORE,
//! this value is not used, it only specifies the number of default texts
EGDT_COUNT
};
//! Names for default skin sizes
const c8* const GUISkinTextNames[] =
{
"MessageBoxOkay",
"MessageBoxCancel",
"MessageBoxYes",
"MessageBoxNo",
"WindowButtonClose",
"WindowButtonMaximize",
"WindowButtonMinimize",
"WindowButtonRestore",
0,
};
//! Customizable symbols for GUI
enum EGUI_DEFAULT_ICON
{
//! maximize window button
EGDI_WINDOW_MAXIMIZE = 0,
//! restore window button
EGDI_WINDOW_RESTORE,
//! close window button
EGDI_WINDOW_CLOSE,
//! minimize window button
EGDI_WINDOW_MINIMIZE,
//! scroll bar up button
EGDI_CURSOR_UP,
//! scroll bar down button
EGDI_CURSOR_DOWN,
//! scroll bar left button
EGDI_CURSOR_LEFT,
//! scroll bar right button
EGDI_CURSOR_RIGHT,
//! icon for menu children
EGDI_MENU_MORE,
//! tick for checkbox
EGDI_CHECK_BOX_CHECKED,
//! down arrow for dropdown menus
EGDI_DROP_DOWN,
//! smaller up arrow
EGDI_SMALL_CURSOR_UP,
//! smaller down arrow
EGDI_SMALL_CURSOR_DOWN,
//! selection dot in a radio button
EGDI_RADIO_BUTTON_CHECKED,
//! file icon for file selection
EGDI_FILE,
//! folder icon for file selection
EGDI_DIRECTORY,
//! value not used, it only specifies the number of icons
EGDI_COUNT
};
const c8* const GUISkinIconNames[] =
{
"windowMaximize",
"windowRestore",
"windowClose",
"windowMinimize",
"cursorUp",
"cursorDown",
"cursorLeft",
"cursorRight",
"menuMore",
"checkBoxChecked",
"dropDown",
"smallCursorUp",
"smallCursorDown",
"radioButtonChecked",
"file",
"directory",
0
};
//! A skin modifies the look of the GUI elements.
class IGUISkin : public virtual io::IAttributeExchangingObject
{
public:
//! destructor
~IGUISkin() {};
//! returns default color
virtual video::SColor getColor(EGUI_DEFAULT_COLOR color) = 0;
//! sets a default color
virtual void setColor(EGUI_DEFAULT_COLOR which, video::SColor newColor) = 0;
//! returns default color
virtual s32 getSize(EGUI_DEFAULT_SIZE size) = 0;
//! Returns a default text.
/** For example for Message box button captions:
"OK", "Cancel", "Yes", "No" and so on. */
virtual const wchar_t* getDefaultText(EGUI_DEFAULT_TEXT text) = 0;
//! Sets a default text.
/** For example for Message box button captions:
"OK", "Cancel", "Yes", "No" and so on. */
virtual void setDefaultText(EGUI_DEFAULT_TEXT which, const wchar_t* newText) = 0;
//! sets a default size
virtual void setSize(EGUI_DEFAULT_SIZE which, s32 size) = 0;
//! returns the default font
virtual IGUIFont* getFont() = 0;
//! sets a default font
virtual void setFont(IGUIFont* font) = 0;
//! returns the sprite bank
virtual IGUISpriteBank* getSpriteBank() = 0;
//! sets the sprite bank
virtual void setSpriteBank(IGUISpriteBank* bank) = 0;
//! Returns a default icon
/** Returns the sprite index within the sprite bank */
virtual u32 getIcon(EGUI_DEFAULT_ICON icon) = 0;
//! Sets a default icon
/** Sets the sprite index used for drawing icons like arrows,
close buttons and ticks in checkboxes
\param icon: Enum specifying which icon to change
\param index: The sprite index used to draw this icon */
virtual void setIcon(EGUI_DEFAULT_ICON icon, u32 index) = 0;
//! draws a standard 3d button pane
/** Used for drawing for example buttons in normal state.
It uses the colors EGDC_3D_DARK_SHADOW, EGDC_3D_HIGH_LIGHT, EGDC_3D_SHADOW and
EGDC_3D_FACE for this. See EGUI_DEFAULT_COLOR for details.
\param element: Pointer to the element which wishes to draw this. This parameter
is usually not used by IGUISkin, but can be used for example by more complex
implementations to find out how to draw the part exactly.
\param rect: Defining area where to draw.
\param clip: Clip area. */
virtual void draw3DButtonPaneStandard(IGUIElement* element,
const core::rect<s32>& rect,
const core::rect<s32>* clip=0) = 0;
//! draws a pressed 3d button pane
/** Used for drawing for example buttons in pressed state.
It uses the colors EGDC_3D_DARK_SHADOW, EGDC_3D_HIGH_LIGHT, EGDC_3D_SHADOW and
EGDC_3D_FACE for this. See EGUI_DEFAULT_COLOR for details.
\param element: Pointer to the element which wishes to draw this. This parameter
is usually not used by IGUISkin, but can be used for example by more complex
implementations to find out how to draw the part exactly.
\param rect: Defining area where to draw.
\param clip: Clip area. */
virtual void draw3DButtonPanePressed(IGUIElement* element,
const core::rect<s32>& rect,
const core::rect<s32>* clip=0) = 0;
//! draws a sunken 3d pane
/** Used for drawing the background of edit, combo or check boxes.
\param element: Pointer to the element which wishes to draw this. This parameter
is usually not used by IGUISkin, but can be used for example by more complex
implementations to find out how to draw the part exactly.
\param bgcolor: Background color.
\param flat: Specifies if the sunken pane should be flat or displayed as sunken
deep into the ground.
\param fillBackGround: Specifies if the background should be filled with the background
color or not be drawn at all.
\param rect: Defining area where to draw.
\param clip: Clip area. */
virtual void draw3DSunkenPane(IGUIElement* element,
video::SColor bgcolor, bool flat, bool fillBackGround,
const core::rect<s32>& rect,
const core::rect<s32>* clip=0) = 0;
//! draws a window background
/** Used for drawing the background of dialogs and windows.
\param element: Pointer to the element which wishes to draw this. This parameter
is usually not used by IGUISkin, but can be used for example by more complex
implementations to find out how to draw the part exactly.
\param titleBarColor: Title color.
\param drawTitleBar: True to enable title drawing.
\param rect: Defining area where to draw.
\param clip: Clip area.
\return Returns rect where it would be good to draw title bar text. */
virtual core::rect<s32> draw3DWindowBackground(IGUIElement* element,
bool drawTitleBar, video::SColor titleBarColor,
const core::rect<s32>& rect,
const core::rect<s32>* clip=0) = 0;
//! draws a standard 3d menu pane
/** Used for drawing for menus and context menus.
It uses the colors EGDC_3D_DARK_SHADOW, EGDC_3D_HIGH_LIGHT, EGDC_3D_SHADOW and
EGDC_3D_FACE for this. See EGUI_DEFAULT_COLOR for details.
\param element: Pointer to the element which wishes to draw this. This parameter
is usually not used by IGUISkin, but can be used for example by more complex
implementations to find out how to draw the part exactly.
\param rect: Defining area where to draw.
\param clip: Clip area. */
virtual void draw3DMenuPane(IGUIElement* element,
const core::rect<s32>& rect,
const core::rect<s32>* clip=0) = 0;
//! draws a standard 3d tool bar
/** Used for drawing for toolbars and menus.
\param element: Pointer to the element which wishes to draw this. This parameter
is usually not used by IGUISkin, but can be used for example by more complex
implementations to find out how to draw the part exactly.
\param rect: Defining area where to draw.
\param clip: Clip area. */
virtual void draw3DToolBar(IGUIElement* element,
const core::rect<s32>& rect,
const core::rect<s32>* clip=0) = 0;
//! draws a tab button
/** Used for drawing for tab buttons on top of tabs.
\param element: Pointer to the element which wishes to draw this. This parameter
is usually not used by IGUISkin, but can be used for example by more complex
implementations to find out how to draw the part exactly.
\param active: Specifies if the tab is currently active.
\param rect: Defining area where to draw.
\param clip: Clip area. */
virtual void draw3DTabButton(IGUIElement* element, bool active,
const core::rect<s32>& rect, const core::rect<s32>* clip=0) = 0;
//! draws a tab control body
/** \param element: Pointer to the element which wishes to draw this. This parameter
is usually not used by IGUISkin, but can be used for example by more complex
implementations to find out how to draw the part exactly.
\param border: Specifies if the border should be drawn.
\param background: Specifies if the background should be drawn.
\param rect: Defining area where to draw.
\param clip: Clip area. */
virtual void draw3DTabBody(IGUIElement* element, bool border, bool background,
const core::rect<s32>& rect, const core::rect<s32>* clip=0) = 0;
//! draws an icon, usually from the skin's sprite bank
/** \param parent: Pointer to the element which wishes to draw this icon.
This parameter is usually not used by IGUISkin, but can be used for example
by more complex implementations to find out how to draw the part exactly.
\param icon: Specifies the icon to be drawn.
\param position: The position to draw the icon
\param starttime: The time at the start of the animation
\param currenttime: The present time, used to calculate the frame number
\param loop: Whether the animation should loop or not
\param clip: Clip area. */
virtual void drawIcon(IGUIElement* element, EGUI_DEFAULT_ICON icon,
const core::position2di position, u32 starttime=0, u32 currenttime=0,
bool loop=false, const core::rect<s32>* clip=0) = 0;
//! get the type of this skin
virtual EGUI_SKIN_TYPE getType() { return EGST_UNKNOWN; };
};
} // end namespace gui
} // end namespace irr
#endif

View File

@ -0,0 +1,73 @@
#ifndef __I_GUI_SPRITE_BANK_H_INCLUDED__
#define __I_GUI_SPRITE_BANK_H_INCLUDED__
#include "IUnknown.h"
#include "irrArray.h"
#include "SColor.h"
#include "rect.h"
namespace irr
{
namespace video
{
class ITexture;
} // end namespace video
namespace gui
{
struct SGUISpriteFrame
{
u32 textureNumber;
u32 rectNumber;
};
struct SGUISprite
{
SGUISprite() : Frames(), frameTime(0) { };
core::array<SGUISpriteFrame> Frames;
u32 frameTime;
};
//! Sprite bank interface.
class IGUISpriteBank : public virtual IUnknown
{
public:
//! Destructor
virtual ~IGUISpriteBank() {};
//! Returns the list of rectangles held by the sprite bank
virtual core::array< core::rect<s32> >& getPositions() = 0;
//! Returns the array of animated sprites within the sprite bank
virtual core::array< SGUISprite >& getSprites() = 0;
//! Returns the number of textures held by the sprite bank
virtual u32 getTextureCount() = 0;
//! Gets the texture with the specified index
virtual video::ITexture* getTexture(u32 index) = 0;
//! Adds a texture to the sprite bank
virtual void addTexture(video::ITexture* texture) = 0;
//! Changes one of the textures in the sprite bank
virtual void setTexture(u32 index, video::ITexture* texture) = 0;
//! Draws a sprite in 2d with position and color
virtual void draw2DSprite(u32 index, const core::position2di& pos, const core::rect<s32>* clip=0,
const video::SColor& color= video::SColor(255,255,255,255),
u32 starttime=0, u32 currenttime=0, bool loop=true, bool center=false) = 0;
};
} // end namespace gui
} // end namespace irr
#endif // __I_GUI_SPRITE_BANK_H_INCLUDED__

View File

@ -0,0 +1,90 @@
// Copyright (C) 2002-2007 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_GUI_STATIC_TEXT_H_INCLUDED__
#define __I_GUI_STATIC_TEXT_H_INCLUDED__
#include "IGUIElement.h"
#include "SColor.h"
namespace irr
{
namespace gui
{
class IGUIFont;
//! Multi or single line text label.
class IGUIStaticText : public IGUIElement
{
public:
//! constructor
IGUIStaticText(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
: IGUIElement(EGUIET_STATIC_TEXT, environment, parent, id, rectangle) {}
//! destructor
~IGUIStaticText() {};
//! Sets another skin independent font.
/** If this is set to zero, the button uses the font of the skin.
\param font: New font to set. */
virtual void setOverrideFont(IGUIFont* font=0) = 0;
//! Gets the override font (if any)
//! \return The override font (may be 0)
virtual IGUIFont * getOverrideFont(void) = 0;
//! Sets another color for the text.
/** If set, the static text does not use the EGDC_BUTTON_TEXT color defined
in the skin, but the set color instead. You don't need to call
IGUIStaticText::enableOverrrideColor(true) after this, this is done
by this function.
If you set a color, and you want the text displayed with the color
of the skin again, call IGUIStaticText::enableOverrideColor(false);
\param color: New color of the text. */
virtual void setOverrideColor(video::SColor color) = 0;
//! Gets the override color
//! \return: The override color
virtual video::SColor const & getOverrideColor(void) = 0;
//! Sets if the static text should use the overide color or the color in the gui skin.
/** \param enable: If set to true, the override color, which can be set
with IGUIStaticText::setOverrideColor is used, otherwise the
EGDC_BUTTON_TEXT color of the skin. */
virtual void enableOverrideColor(bool enable) = 0;
//! Checks if an override color is enabled
//! \return true if the override color is enabled, false otherwise
virtual bool isOverrideColorEnabled(void) = 0;
//! Enables or disables word wrap for using the static text as multiline text control.
/** \param enable: If set to true, words going over one line are
breaked to the next line. */
virtual void setWordWrap(bool enable) = 0;
//! Checks if word wrap is enabled
//! \return true if word wrap is enabled, false otherwise
virtual bool isWordWrapEnabled(void) = 0;
//! Returns the height of the text in pixels when it is drawn.
/** This is useful for adjusting the layout of gui elements based on the height
of the multiline text in this element.
\return Returns height of text in pixels. */
virtual s32 getTextHeight() = 0;
//! Returns the width of the current text, in the current font
/** If the text is broken, this returns the width of the widest line
\return The width of the text, or the widest broken line. */
virtual s32 getTextWidth(void) = 0;
};
} // end namespace gui
} // end namespace irr
#endif

View File

@ -0,0 +1,81 @@
// Copyright (C) 2002-2007 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_GUI_TAB_CONTROL_H_INCLUDED__
#define __I_GUI_TAB_CONTROL_H_INCLUDED__
#include "IGUIElement.h"
#include "SColor.h"
namespace irr
{
namespace gui
{
//! A tab, onto which other gui elements could be added.
class IGUITab : public IGUIElement
{
public:
//! constructor
IGUITab(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
: IGUIElement(EGUIET_TAB, environment, parent, id, rectangle) {}
//! destructor
virtual ~IGUITab() {};
//! Returns number of tab if in tabcontrol.
/** Can be accessed later IGUITabControl::getTab() by this number. */
virtual s32 getNumber() = 0;
//! sets if the tab should draw its background
virtual void setDrawBackground(bool draw=true) = 0;
//! sets the color of the background, if it should be drawn.
virtual void setBackgroundColor(video::SColor c) = 0;
};
//! A standard tab control
class IGUITabControl : public IGUIElement
{
public:
//! constructor
IGUITabControl(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
: IGUIElement(EGUIET_TAB_CONTROL, environment, parent, id, rectangle) {}
//! destructor
virtual ~IGUITabControl() {};
//! Adds a tab
virtual IGUITab* addTab(const wchar_t* caption, s32 id=-1) = 0;
//! Returns amount of tabs in the tabcontrol
virtual s32 getTabcount() = 0;
//! Returns a tab based on zero based index
/** \param idx: zero based index of tab. Is a value betwenn 0 and getTabcount()-1;
\return Returns pointer to the Tab. Returns 0 if no tab
is corresponding to this tab. */
virtual IGUITab* getTab(s32 idx) = 0;
//! Brings a tab to front.
/** \param idx: number of the tab.
\return Returns true if successful. */
virtual bool setActiveTab(s32 idx) = 0;
//! Brings a tab to front.
/** \param idx: pointer to the tab.
\return Returns true if successful. */
virtual bool setActiveTab(IGUIElement *tab) = 0;
//! Returns which tab is currently active
virtual s32 getActiveTab() = 0;
};
} // end namespace gui
} // end namespace irr
#endif

View File

@ -0,0 +1,43 @@
// Copyright (C) 2002-2007 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_GUI_TOOL_BAR_H_INCLUDED__
#define __I_GUI_TOOL_BAR_H_INCLUDED__
#include "IGUIElement.h"
namespace irr
{
namespace video
{
class ITexture;
} // end namespace video
namespace gui
{
class IGUIButton;
//! Stays at the top of its parent like the menu bar and contains tool buttons
class IGUIToolBar : public IGUIElement
{
public:
//! constructor
IGUIToolBar(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
: IGUIElement(EGUIET_TOOL_BAR, environment, parent, id, rectangle) {}
//! destructor
~IGUIToolBar() {};
//! Adds a button to the tool bar
virtual IGUIButton* addButton(s32 id=-1, const wchar_t* text=0,const wchar_t* tooltiptext=0,
video::ITexture* img=0, video::ITexture* pressedimg=0,
bool isPushButton=false, bool useAlphaChannel=false) = 0;
};
} // end namespace gui
} // end namespace irr
#endif

View File

@ -0,0 +1,60 @@
// Copyright (C) 2002-2007 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_GUI_WINDOW_H_INCLUDED__
#define __I_GUI_WINDOW_H_INCLUDED__
#include "IGUIButton.h"
namespace irr
{
namespace gui
{
//! enumeration for message box layout flags
enum EMESSAGE_BOX_FLAG
{
//! Flag for the ok button
EMBF_OK = 0x1,
//! Flag for the cancel button
EMBF_CANCEL = 0x2,
//! Flag for the yes button
EMBF_YES = 0x4,
//! Flag for the no button
EMBF_NO = 0x8,
//! This value is not used. It only forces this enumeration to compile in 32 bit.
EMBF_FORCE_32BIT = 0x7fffffff
};
//! Default moveable window GUI element with border, caption and close icons.
class IGUIWindow : public IGUIElement
{
public:
//! constructor
IGUIWindow(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
: IGUIElement(EGUIET_WINDOW, environment, parent, id, rectangle) {}
//! destructor
virtual ~IGUIWindow() {};
//! Returns pointer to the close button
virtual IGUIButton* getCloseButton() = 0;
//! Returns pointer to the minimize button
virtual IGUIButton* getMinimizeButton() = 0;
//! Returns pointer to the maximize button
virtual IGUIButton* getMaximizeButton() = 0;
};
} // end namespace gui
} // end namespace irr
#endif

View File

@ -0,0 +1,104 @@
// Copyright (C) 2002-2007 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_IMAGE_H_INCLUDED__
#define __I_IMAGE_H_INCLUDED__
#include "IUnknown.h"
#include "position2d.h"
#include "SColor.h"
namespace irr
{
namespace video
{
//! An enum for the color format of textures used by the Irrlicht Engine.
/** A color format specifies how color information is stored. */
enum ECOLOR_FORMAT
{
//! 16 bit color format used by the software driver, and thus preferred
//! by all other irrlicht engine video drivers. There are 5 bits for every
//! color component, and a single bit is left for alpha information.
ECF_A1R5G5B5 = 0,
//! Standard 16 bit color format.
ECF_R5G6B5,
//! 24 bit color, no alpha channel, but 8 bit for red, green and blue.
ECF_R8G8B8,
//! Default 32 bit color format. 8 bits are used for every component:
//! red, green, blue and alpha.
ECF_A8R8G8B8
};
//! Interface for software image data.
/** Image loaders create these images from files. IVideoDrivers convert
these images into their (hardware) textures.
*/
class IImage : public virtual IUnknown
{
public:
//! destructor
virtual ~IImage() {};
//! Lock function. Use this to get a pointer to the image data. After you
//! don't need the pointer anymore, you must call unlock().
//! \return Returns pointer to the image data. What type of data
//! is pointed to depends on the color format of the image. For example
//! if the color format is ECF_A8R8G8B8, it is of s32.
//! Be sure to call unlock() after you don't need the pointer any more.
virtual void* lock() = 0;
//! Unlock function.
//! Should be called after the pointer received by lock() is not
//! needed anymore.
virtual void unlock() = 0;
//! Returns width and height of image data.
virtual const core::dimension2d<s32>& getDimension() = 0;
//! Returns bits per pixel.
virtual s32 getBitsPerPixel() = 0;
//! Returns bytes per pixel
virtual s32 getBytesPerPixel() = 0;
//! Returns image data size in bytes
virtual s32 getImageDataSizeInBytes() = 0;
//! Returns image data size in pixels
virtual s32 getImageDataSizeInPixels() = 0;
//! returns a pixel
virtual SColor getPixel(s32 x, s32 y) = 0;
//! returns the color format
virtual ECOLOR_FORMAT getColorFormat() const = 0;
//! returns mask for red value of a pixel
virtual u32 getRedMask() = 0;
//! returns mask for green value of a pixel
virtual u32 getGreenMask() = 0;
//! returns mask for blue value of a pixel
virtual u32 getBlueMask() = 0;
//! returns mask for alpha value of a pixel
virtual u32 getAlphaMask() = 0;
//! returns pitch of image
virtual u32 getPitch() const = 0;
};
} // end namespace video
} // end namespace irr
#endif

View File

@ -0,0 +1,45 @@
// Copyright (C) 2002-2007 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_SURFACE_LOADER_H_INCLUDED__
#define __I_SURFACE_LOADER_H_INCLUDED__
#include "IUnknown.h"
#include "IReadFile.h"
#include "IImage.h"
namespace irr
{
namespace video
{
//! Class which is able to create a image from a file.
/** If you want the Irrlicht Engine be able to load textures of
currently unsupported file formats (e.g .gif), then implement
this and add your new Surface loader with
IVideoDriver::addExternalImageLoader() to the engine. */
class IImageLoader : public virtual IUnknown
{
public:
//! destructor
virtual ~IImageLoader() {};
//! returns true if the file maybe is able to be loaded by this class
//! based on the file extension (e.g. ".tga")
virtual bool isALoadableFileExtension(const c8* fileName) = 0;
//! returns true if the file maybe is able to be loaded by this class
virtual bool isALoadableFileFormat(irr::io::IReadFile* file) = 0;
//! creates a surface from the file
virtual IImage* loadImage(irr::io::IReadFile* file) = 0;
};
} // end namespace video
} // end namespace irr
#endif

View File

@ -0,0 +1,43 @@
#ifndef _I_IMAGE_WRITER_H_INCLUDED__
#define _I_IMAGE_WRITER_H_INCLUDED__
#include "irrTypes.h"
#include "IUnknown.h"
namespace irr
{
namespace io
{
class IWriteFile;
} // end namespace io
namespace video
{
class IImage;
//! Interface for writing software image data.
class IImageWriter : public IUnknown
{
public:
//! constructor
IImageWriter()
{
}
//! destructor
virtual ~IImageWriter()
{
};
//! return true if this writer can write a file with the given extension
virtual bool isAWriteableFileExtension(const c8* fileName) = 0;
//! write image to file
virtual bool writeImage(io::IWriteFile *file, IImage *image, u32 param = 0) = 0;
};
} // namespace video
} // namespace irr
#endif // _I_IMAGE_WRITER_H_INCLUDED__

View File

@ -0,0 +1,46 @@
// Copyright (C) 2002-2007 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_LIGHT_SCENE_NODE_H_INCLUDED__
#define __I_LIGHT_SCENE_NODE_H_INCLUDED__
#include "ISceneNode.h"
#include "SLight.h"
namespace irr
{
namespace scene
{
//! Scene node which is a dynamic light.
/** You can switch the light on and off by
making it visible or not, and let it be animated by ordinary scene node animators.
If you set the light type to be directional, you will need to set the direction of the
light source manually in the SLight structure, the position of the scene node will have no
effect on this direction.
*/
class ILightSceneNode : public ISceneNode
{
public:
//! constructor
ILightSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id,
const core::vector3df& position = core::vector3df(0,0,0))
: ISceneNode(parent, mgr, id, position) {}
//! Sets the light data associated with this ILightSceneNode
virtual void setLightData(const video::SLight& light) = 0;
//! Gets the light data associated with this ILightSceneNode
//! \return Returns the light data.
virtual video::SLight& getLightData() = 0;
};
} // end namespace scene
} // end namespace irr
#endif

View File

@ -0,0 +1,95 @@
// Copyright (C) 2002-2007 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_LOGGER_H_INCLUDED__
#define __I_LOGGER_H_INCLUDED__
#include "IUnknown.h"
namespace irr
{
enum ELOG_LEVEL
{
//! High log level, warnings, errors and important information
//! texts are printed out.
ELL_INFORMATION = 0,
//! Default log level, warnings and errors are printed out
ELL_WARNING,
//! Low log level, only errors are printed into the log
ELL_ERROR,
//! Nothing is printed out to the log
ELL_NONE
};
//! Interface for logging messages, warnings and errors
class ILogger : public virtual IUnknown
{
public:
//! destructor
virtual ~ILogger() {}
//! Returns the current set log level.
virtual ELOG_LEVEL getLogLevel() = 0;
//! Sets a new log level. With this value, texts which are sent to
//! the logger are filtered out. For example setting this value to
//! ELL_WARNING, only warnings and
//! errors are printed out. Setting it to ELL_INFORMATION, which is
//! the default setting, warnings,
//! errors and informational texts are printed out.
//! \param ll: new log level filter value.
virtual void setLogLevel(ELOG_LEVEL ll) = 0;
//! Prints out a text into the log
//! \param text: Text to print out.
//! \param ll: Log level of the text. If the text is an error, set
//! it to ELL_ERROR, if it is warning set it to ELL_WARNING, and if it
//! is just an informational text, set it to ELL_INFORMATION. Texts are
//! filtered with these levels. If you want to be a text displayed,
//! independent on what level filter is set, use ELL_NONE.
virtual void log(const c8* text, ELOG_LEVEL ll=ELL_INFORMATION) = 0;
//! Prints out a text into the log
//! \param text: Text to print out.
//! \param hint: Additional info. This string is added after a " :" to the
//! string.
//! \param ll: Log level of the text. If the text is an error, set
//! it to ELL_ERROR, if it is warning set it to ELL_WARNING, and if it
//! is just an informational text, set it to ELL_INFORMATION. Texts are
//! filtered with these levels. If you want to be a text displayed,
//! independent on what level filter is set, use ELL_NONE.
virtual void log(const c8* text, const c8* hint, ELOG_LEVEL ll=ELL_INFORMATION) = 0;
//! Prints out a text into the log
//! \param text: Text to print out.
//! \param hint: Additional info. This string is added after a " :" to the
//! string.
//! \param ll: Log level of the text. If the text is an error, set
//! it to ELL_ERROR, if it is warning set it to ELL_WARNING, and if it
//! is just an informational text, set it to ELL_INFORMATION. Texts are
//! filtered with these levels. If you want to be a text displayed,
//! independent on what level filter is set, use ELL_NONE.
virtual void log(const wchar_t* text, const wchar_t* hint, ELOG_LEVEL ll=ELL_INFORMATION) = 0;
//! Prints out a text into the log
//! \param text: Text to print out.
//! \param ll: Log level of the text. If the text is an error, set
//! it to ELL_ERROR, if it is warning set it to ELL_WARNING, and if it
//! is just an informational text, set it to ELL_INFORMATION. Texts are
//! filtered with these levels. If you want to be a text displayed,
//! independent on what level filter is set, use ELL_NONE.
virtual void log(const wchar_t* text, ELOG_LEVEL ll=ELL_INFORMATION) = 0;
};
} // end namespace
#endif

View File

@ -0,0 +1,97 @@
// Copyright (C) 2002-2007 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_MATERIAL_RENDERER_H_INCLUDED__
#define __I_MATERIAL_RENDERER_H_INCLUDED__
#include "IUnknown.h"
#include "SMaterial.h"
#include "S3DVertex.h"
namespace irr
{
namespace video
{
class IVideoDriver;
class IMaterialRendererServices;
//! Interface for material rendering. Can be used to extend the engine with new materials.
/** Refer to IVideoDriver::addMaterialRenderer() for more informations on how to extend the engine
with new materials.
*/
class IMaterialRenderer : public virtual IUnknown
{
public:
//! destructor
virtual ~IMaterialRenderer() {};
//! Called by the IVideoDriver implementation the let the renderer set its needed render states.
/** This is called during the IVideoDriver::setMaterial() call.
When overriding this, you can set some renderstates or for example a vertex or pixel shader
if you like.
\param material: The new material parameters to be set. The renderer may change the material
flags in this material. For example if this material does not accept the zbuffer = true, it
can set it to false. This is useful, because in the next lastMaterial will be just the material
in this call.
\param lastMaterial: The material parameters which have been set before this material.
\param resetAllRenderstates: True if all renderstates should really be reset. This is usually
true if the last rendering mode was not a usual 3d rendering mode, but for example
a 2d rendering mode.
You should reset really all renderstates if this is true, no matter if the lastMaterial had
some similar settings. This is used because in most cases, some common renderstates are not
changed if they are already there, for example bilinear filtering, wireframe, gouraudshading,
lighting, zbuffer, zwriteenable, backfaceculling and fogenable.
\param services: Interface providing some methods for changing advanced, internal
states of a IVideoDriver. */
virtual void OnSetMaterial(SMaterial& material, const SMaterial& lastMaterial,
bool resetAllRenderstates, IMaterialRendererServices* services) {};
//! Called every time before a new bunch of geometry is being drawn using this material with
//! for example drawIndexedTriangleList() call.
/** OnSetMaterial should normally only be called if the renderer decides that the renderstates should be changed, it won't be called if for
example two drawIndexedTriangleList() will be called with the same material set. This
method will be called every time. This is useful for example for materials with shaders,
which don't only set new renderstates but also shader constants.
\param service: Pointer to interface providing methos for setting constants and other things.
\param vtxtype: Vertex type with which the next rendering will be done. This can be used
by the material renderer to set some specific optimized shaders or if this is an incompatible
vertex type for this renderer, to refuse rendering for example.
\return Returns true if everything is ok, and false if nothing should be rendered.
The material renderer can choose to return false for example if he doesn't support the
specified vertex type. This is actually done in D3D8 and D3D9 when using a
normal mapped material with a vertex type other than EVT_TANGENTS. */
virtual bool OnRender(IMaterialRendererServices* service, E_VERTEX_TYPE vtxtype) { return true; };
//! Called by the IVideoDriver to unset this material.
/** Called during the
IVideoDriver::setMaterial() call before the new material will get the OnSetMaterial()
call. */
virtual void OnUnsetMaterial() {};
//! Returns if the material is transparent.
/** The scene managment needs to know this
for being able to sort the materials by opaque and transparent. */
virtual bool isTransparent() { return false; }
//! Returns the render capability of the material.
/** Because some more complex materials
are implemented in multiple ways and need special hardware capabilities, it is possible
to query how the current material renderer is performing on the current hardware with this
function.
\return Returns 0 if everything is running fine. Any other value is material renderer
specific and means for example that the renderer switched back to a fall back material because
it cannot use the latest shaders. More specific examples:
Fixed function pipeline materials should return 0 in most cases, parallax mapped
material will only return 0 when at least pixel shader 1.4 is available on that machine. */
virtual s32 getRenderCapability() { return 0; }
};
} // end namespace video
} // end namespace irr
#endif

Some files were not shown because too many files have changed in this diff Show More