Merging r6196 through r6248 from trunk to ogl-es branch

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/branches/ogl-es@6249 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
cutealien
2021-08-26 21:57:27 +00:00
committed by sfan5
parent c26ff3476f
commit 9690c1b3e3
56 changed files with 3123 additions and 245 deletions

View File

@ -5,6 +5,8 @@
#ifndef __E_GUI_ALIGNMENT_H_INCLUDED__
#define __E_GUI_ALIGNMENT_H_INCLUDED__
#include "irrTypes.h"
namespace irr
{
namespace gui
@ -35,4 +37,3 @@ const c8* const GUIAlignmentNames[] =
} // namespace irr
#endif // __E_GUI_ALIGNMENT_H_INCLUDED__

View File

@ -258,10 +258,14 @@ public:
Note that it usually works badly to pass the modal screen already as parent when creating
a new element. It's better to add that new element later to the modal screen with addChild.
\param parent Parent gui element of the modal.
\param blinkMode Bitset of when to blink (can be combined)
0 = never
1 = focus changes
2 = Left mouse button pressed down
\return Pointer to the created modal. Returns 0 if an error occurred.
This pointer should not be dropped. See IReferenceCounted::drop() for
more information. */
virtual IGUIElement* addModalScreen(IGUIElement* parent) = 0;
virtual IGUIElement* addModalScreen(IGUIElement* parent, int blinkMode = 3) = 0;
//! Adds a message box.
/** \param caption Text to be displayed the title of the message box.

View File

@ -7,7 +7,7 @@
#include "IReferenceCounted.h"
#include "irrArray.h"
#include "EHardwareBufferFlags.h"
#include "SVertexIndex.h"
namespace irr

View File

@ -39,7 +39,7 @@ namespace video
//! Returns an array of previously set textures.
const core::array<ITexture*>& getTexture() const
{
return Texture;
return Textures;
}
//! Returns a of previously set depth / depth-stencil texture.
@ -48,34 +48,49 @@ namespace video
return DepthStencil;
}
//! Returns an array of active surface for cube textures
const core::array<E_CUBE_SURFACE>& getCubeSurfaces() const
{
return CubeSurfaces;
}
//! Set multiple textures.
/** Set multiple textures for the render target.
\param texture Array of texture objects. These textures are used for a color outputs.
\param depthStencil Depth or packed depth-stencil texture. This texture is used as depth
or depth-stencil buffer.
or depth-stencil buffer. You can pass getDepthStencil() if you don't want to change it.
\param cubeSurfaces When rendering to cube textures, set the surface to be used for each texture. Can be empty otherwise.
*/
virtual void setTexture(const core::array<ITexture*>& texture, ITexture* depthStencil, const core::array<E_CUBE_SURFACE>& cubeSurfaces = core::array<E_CUBE_SURFACE>()) = 0;
void setTexture(const core::array<ITexture*>& texture, ITexture* depthStencil, const core::array<E_CUBE_SURFACE>& cubeSurfaces = core::array<E_CUBE_SURFACE>())
{
setTextures(texture.const_pointer(), texture.size(), depthStencil, cubeSurfaces.const_pointer(), cubeSurfaces.size());
}
//! Set one texture.
//! Sets one texture + depthStencil
//! You can pass getDepthStencil() for depthStencil if you don't want to change that one
void setTexture(ITexture* texture, ITexture* depthStencil)
{
core::array<ITexture*> textureArray(1);
textureArray.push_back(texture);
setTexture(textureArray, depthStencil);
if ( texture )
{
setTextures(&texture, 1, depthStencil);
}
else
{
setTextures(0, 0, depthStencil);
}
}
//! Set one cube surface texture.
void setTexture(ITexture* texture, ITexture* depthStencil, E_CUBE_SURFACE cubeSurface)
{
core::array<ITexture*> textureArray(1);
textureArray.push_back(texture);
core::array<E_CUBE_SURFACE> cubeSurfaces(1);
cubeSurfaces.push_back(cubeSurface);
setTexture(textureArray, depthStencil, cubeSurfaces);
if ( texture )
{
setTextures(&texture, 1, depthStencil, &cubeSurface, 1);
}
else
{
setTextures(0, 0, depthStencil, &cubeSurface, 1);
}
}
//! Get driver type of render target.
@ -86,8 +101,12 @@ namespace video
protected:
//! Set multiple textures.
// NOTE: working with pointers instead of arrays to avoid unnecessary memory allocations for the single textures case
virtual void setTextures(ITexture* const * textures, u32 numTextures, ITexture* depthStencil, const E_CUBE_SURFACE* cubeSurfaces=0, u32 numCubeSurfaces=0) = 0;
//! Textures assigned to render target.
core::array<ITexture*> Texture;
core::array<ITexture*> Textures;
//! Depth or packed depth-stencil texture assigned to render target.
ITexture* DepthStencil;

View File

@ -97,6 +97,14 @@ enum E_TEXTURE_CREATION_FLAG
*/
ETCF_AUTO_GENERATE_MIP_MAPS = 0x00000100,
//! Enable support for vertex shader texture sampling on some drivers
/** Default is false.
This adds a small costs to all texture switches.
Currently only affects D3D9.
On OpenGL vertex shaders use the same texture unit as pixel shaders, so support there only depends on GL version and not on this flag
*/
ETCF_SUPPORT_VERTEXT_TEXTURE = 0x00000200,
/** This flag is never used, it only forces the compiler to compile
these enumeration values to 32 bit. */
ETCF_FORCE_32_BIT_DO_NOT_USE = 0x7fffffff

View File

@ -7,6 +7,7 @@
#include "IReferenceCounted.h"
#include "irrArray.h"
#include "EHardwareBufferFlags.h"
#include "S3DVertex.h"
namespace irr

View File

@ -483,7 +483,7 @@ namespace video
example in picture edit programs. To avoid this problem, you
could use the makeColorKeyTexture method, which takes the
position of a pixel instead a color value.
\param zeroTexels \deprecated If set to true, then any texels that match
\param zeroTexels (deprecated) If set to true, then any texels that match
the color key will have their color, as well as their alpha, set to zero
(i.e. black). This behavior matches the legacy (buggy) behavior prior
to release 1.5 and is provided for backwards compatibility only.
@ -500,7 +500,7 @@ namespace video
\param colorKeyPixelPos Position of a pixel with the color key
color. Every texel with this color will become fully transparent as
described above.
\param zeroTexels \deprecated If set to true, then any texels that match
\param zeroTexels (deprecated) If set to true, then any texels that match
the color key will have their color, as well as their alpha, set to zero
(i.e. black). This behavior matches the legacy (buggy) behavior prior
to release 1.5 and is provided for backwards compatibility only.

View File

@ -340,7 +340,7 @@ for Windows based systems. You also have to set #define UNICODE for this to comp
#undef _IRR_WCHAR_FILESYSTEM
#endif
//! Define _IRR_COMPILE_WITH_JPEGLIB_ to enable compiling the engine using libjpeg.
//! Define _IRR_COMPILE_WITH_LIBJPEG_ to enable compiling the engine using libjpeg.
/** This enables the engine to read jpeg images. If you comment this out,
the engine will no longer read .jpeg images. */
#define _IRR_COMPILE_WITH_LIBJPEG_

View File

@ -30,7 +30,7 @@ namespace irr
Bits(32),
ZBufferBits(24),
Fullscreen(false),
WindowResizable(false),
WindowResizable(2),
Stencilbuffer(true),
Vsync(false),
AntiAlias(0),
@ -131,8 +131,9 @@ namespace irr
//! Should a non-fullscreen window be resizable.
/** Might not be supported by all devices. Ignored when Fullscreen is true.
Default: false */
bool WindowResizable;
Values: 0 = not resizable, 1 = resizable, 2 = system decides default itself
Default: 2*/
u8 WindowResizable;
//! Specifies if the stencil buffer should be enabled.
/** Set this to true, if you want the engine be able to draw

View File

@ -6,6 +6,7 @@
#define __S_LIGHT_H_INCLUDED__
#include "SColor.h"
#include "vector3d.h"
namespace irr
{
@ -98,4 +99,3 @@ struct SLight
} // end namespace irr
#endif

View File

@ -5,6 +5,7 @@
#ifndef __S_VERTEX_MANIPULATOR_H_INCLUDED__
#define __S_VERTEX_MANIPULATOR_H_INCLUDED__
#include "matrix4.h"
#include "S3DVertex.h"
#include "SColor.h"

View File

@ -5,6 +5,8 @@
#ifndef __I_SCENE_PARAMETERS_H_INCLUDED__
#define __I_SCENE_PARAMETERS_H_INCLUDED__
#include "irrTypes.h"
/*! \file SceneParameters.h
\brief Header file containing all scene parameters for modifying mesh loading etc.

View File

@ -13,6 +13,13 @@ namespace irr
namespace core
{
//! Selection of characters which count as decimal point in fast_atof
//! By default Irrlicht considers "." as the decimal point in numbers.
//! But sometimes you might run into situations where floats were written in
//! a local format with another decimal point like ",".
//! Best solution is usually to fix those cases by converting the input.
//! But if you don't have that choice you can set this to ".,".
//! WARNING: This is not thread-safe, so don't change while there's a chance
//! of another thread using fast_atof functions at the same time.
// TODO: This should probably also be used in irr::core::string, but
// the float-to-string code used there has to be rewritten first.
IRRLICHT_API extern irr::core::stringc LOCALE_DECIMAL_POINTS;

View File

@ -231,6 +231,40 @@ public:
free_when_destroyed=_free_when_destroyed;
}
//! Set (copy) data from given memory block
/** \param newData data to set, must have newSize elements
\param newSize Amount of elements in newData
\param canShrink When true we reallocate the array even it can shrink.
May reduce memory usage, but call is more whenever size changes.
\param newDataIsSorted Info if you pass sorted/unsorted data
*/
void set_data(const T* newData, u32 newSize, bool newDataIsSorted=false, bool canShrink=false)
{
reallocate(newSize, canShrink);
set_used(newSize);
for ( u32 i=0; i<newSize; ++i)
{
data[i] = newData[i];
}
is_sorted = newDataIsSorted;
}
//! Compare if given data block is identical to the data in our array
/** Like operator ==, but without the need to create the array
\param otherData Address to data against which we compare, must contain size elements
\param size Amount of elements in otherData */
bool equals(const T* otherData, u32 size) const
{
if (used != size)
return false;
for (u32 i=0; i<size; ++i)
if (data[i] != otherData[i])
return false;
return true;
}
//! Sets if the array should delete the memory it uses upon destruction.
/** Also clear and set_pointer will only delete the (original) memory
@ -258,7 +292,6 @@ public:
used = usedNow;
}
//! Assignment operator
const array<T, TAlloc>& operator=(const array<T, TAlloc>& other)
{
@ -290,13 +323,7 @@ public:
//! Equality operator
bool operator == (const array<T, TAlloc>& other) const
{
if (used != other.used)
return false;
for (u32 i=0; i<other.used; ++i)
if (data[i] != other[i])
return false;
return true;
return equals(other.const_pointer(), other.size());
}

View File

@ -2,7 +2,8 @@
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __LEAK_HUNTER_INCLUDEED__
#ifndef __LEAK_HUNTER_INCLUDED__
#define __LEAK_HUNTER_INCLUDED__
#include "IrrCompileConfig.h"

View File

@ -295,7 +295,8 @@ class line2d
}
//! Get the closest point on this line to a point
/** \param checkOnlySegments: Default (true) is to return a point on the line-segment (between begin and end) of the line.
/** \param point: Starting search at this point
\param checkOnlySegments: Default (true) is to return a point on the line-segment (between begin and end) of the line.
When set to false the function will check for the first the closest point on the the line even when outside the segment. */
vector2d<T> getClosestPoint(const vector2d<T>& point, bool checkOnlySegments=true) const
{

View File

@ -13,7 +13,9 @@ namespace io
{
//! Type used for all file system related strings.
/** This type will transparently handle different file system encodings. */
/** This type will transparently handle different file system encodings.
NOTE: For historical reasons the tool-functions using io::path are all in coreutil.h
*/
typedef core::string<fschar_t> path;
//! Used in places where we identify objects by a filename, but don't actually work with the real filename