SLProject  4.3.020
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
SL.h File Reference
#include <Utils.h>
Include dependency graph for SL.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define SL_GETBIT(VAR, VAL)   VAR& VAL
 Bit manipulation macros for ones that forget it always. More...
 
#define SL_SETBIT(VAR, VAL)   VAR |= VAL
 
#define SL_DELBIT(VAR, VAL)   VAR &= ~VAL
 
#define SL_TOGBIT(VAR, VAL)
 
#define UNUSED_PARAMETER(r)   ((void)(x))
 Silences the unused-parameter warning in XCode. More...
 
#define SL_LOG(...)   Utils::log("SLProject", __VA_ARGS__)
 Some debugging and error handling macros. More...
 
#define SL_LOG_DEBUG(...)
 
#define SL_EXIT_MSG(message)   Utils::exitMsg("SLProject", (message), __LINE__, __FILE__)
 
#define SL_WARN_MSG(message)   Utils::warnMsg("SLProject", (message), __LINE__, __FILE__)
 

Typedefs

typedef string SLstring
 Redefinition of standard types for platform independence. More...
 
typedef std::wstring SLwstring
 analog to std::wstring, not available on Android More...
 
typedef char SLchar
 analog to GLchar (char is signed [-128 ... 127]!) More...
 
typedef unsigned char SLuchar
 analog to GLuchar More...
 
typedef signed long SLlong
 analog to GLlong More...
 
typedef unsigned long SLulong
 analog to GLulong More...
 
typedef signed char SLbyte
 analog to GLbyte More...
 
typedef unsigned char SLubyte
 analog to GLubyte More...
 
typedef short SLshort
 analog to GLshort More...
 
typedef unsigned short SLushort
 analog to GLushort More...
 
typedef int SLint
 analog to GLint More...
 
typedef unsigned int SLuint
 analog to GLuint More...
 
typedef int SLsizei
 analog to GLsizei More...
 
typedef float SLfloat
 analog to GLfloat More...
 
typedef double SLdouble
 analog to GLdouble More...
 
typedef bool SLbool
 analog to GLbool More...
 
typedef unsigned int SLenum
 analog to GLenum More...
 
typedef unsigned int SLbitfield
 analog to GLbitfield More...
 
typedef int8_t SLint8
 8 bit signed integer More...
 
typedef uint8_t SLuint8
 8 bit unsigned integer More...
 
typedef int16_t SLint16
 16 bit signed integer More...
 
typedef uint16_t SLuint16
 16 bit unsigned integer More...
 
typedef int32_t SLint32
 32 bit signed integer More...
 
typedef uint32_t SLuint32
 32 bit unsigned integer More...
 
typedef int64_t SLint64
 64 bit signed integer More...
 
typedef uint64_t SLuint64
 64 bit unsigned integer More...
 
typedef vector< SLboolSLVbool
 All 1D vectors begin with SLV*. More...
 
typedef vector< SLbyteSLVbyte
 
typedef vector< SLubyteSLVubyte
 
typedef vector< SLcharSLVchar
 
typedef vector< SLucharSLVuchar
 
typedef vector< SLshortSLVshort
 
typedef vector< SLushortSLVushort
 
typedef vector< SLintSLVint
 
typedef vector< SLuintSLVuint
 
typedef vector< SLlongSLVlong
 
typedef vector< SLulongSLVulong
 
typedef vector< SLfloatSLVfloat
 
typedef vector< SLstringSLVstring
 
typedef vector< size_t > SLVsize_t
 
typedef vector< vector< SLfloat > > SLVVfloat
 All 2D vectors begin with SLVV*. More...
 
typedef vector< vector< SLuchar > > SLVVuchar
 
typedef vector< vector< SLushort > > SLVVushort
 
typedef vector< vector< SLuint > > SLVVuint
 
typedef vector< vector< SLchar > > SLVVchar
 
typedef vector< vector< SLshort > > SLVVshort
 
typedef vector< vector< SLint > > SLVVint
 

Functions

template<class T >
SLuint SL_sizeOfVector (const T &vector)
 Returns the memory in bytes reserved by a vector. More...
 

Macro Definition Documentation

◆ SL_DELBIT

#define SL_DELBIT (   VAR,
  VAL 
)    VAR &= ~VAL

Definition at line 259 of file SL.h.

◆ SL_EXIT_MSG

#define SL_EXIT_MSG (   message)    Utils::exitMsg("SLProject", (message), __LINE__, __FILE__)

Definition at line 288 of file SL.h.

◆ SL_GETBIT

#define SL_GETBIT (   VAR,
  VAL 
)    VAR& VAL

Bit manipulation macros for ones that forget it always.

VAR is the bit field, VAL the bit mask to test or modify. The arguments are not parenthesised, so pass plain variables rather than expressions. SL_TOGBIT expands to a bare if/else and must not be used as the body of an unbraced if, or it will bind to the wrong else.

Definition at line 257 of file SL.h.

◆ SL_LOG

#define SL_LOG (   ...)    Utils::log("SLProject", __VA_ARGS__)

Some debugging and error handling macros.

All four tag their output with "SLProject" and forward to the Utils namespace. SL_LOG_DEBUG compiles to nothing outside debug builds. SL_EXIT_MSG terminates the application; SL_WARN_MSG only reports. Both pass LINE and FILE so the origin appears in the message.

Definition at line 279 of file SL.h.

◆ SL_LOG_DEBUG

#define SL_LOG_DEBUG (   ...)
Value:
{ \
}

Definition at line 283 of file SL.h.

◆ SL_SETBIT

#define SL_SETBIT (   VAR,
  VAL 
)    VAR |= VAL

Definition at line 258 of file SL.h.

◆ SL_TOGBIT

#define SL_TOGBIT (   VAR,
  VAL 
)
Value:
if ((VAR) & (VAL)) \
(VAR) &= ~(VAL); \
else \
(VAR) |= VAL

Definition at line 260 of file SL.h.

◆ SL_WARN_MSG

#define SL_WARN_MSG (   message)    Utils::warnMsg("SLProject", (message), __LINE__, __FILE__)

Definition at line 289 of file SL.h.

◆ UNUSED_PARAMETER

#define UNUSED_PARAMETER (   r)    ((void)(x))

Silences the unused-parameter warning in XCode.

Warning
Defective and unused: the parameter is named r while the body casts x, so any use fails to compile unless an unrelated x is in scope. It has no callers anywhere in the project. Fix the argument name or delete it before using it.

Definition at line 271 of file SL.h.

Typedef Documentation

◆ SLbitfield

typedef unsigned int SLbitfield

analog to GLbitfield

Definition at line 204 of file SL.h.

◆ SLbool

typedef bool SLbool

analog to GLbool

Definition at line 202 of file SL.h.

◆ SLbyte

typedef signed char SLbyte

analog to GLbyte

Definition at line 193 of file SL.h.

◆ SLchar

typedef char SLchar

analog to GLchar (char is signed [-128 ... 127]!)

Definition at line 189 of file SL.h.

◆ SLdouble

typedef double SLdouble

analog to GLdouble

Definition at line 201 of file SL.h.

◆ SLenum

typedef unsigned int SLenum

analog to GLenum

Definition at line 203 of file SL.h.

◆ SLfloat

typedef float SLfloat

analog to GLfloat

Definition at line 200 of file SL.h.

◆ SLint

typedef int SLint

analog to GLint

Definition at line 197 of file SL.h.

◆ SLint16

typedef int16_t SLint16

16 bit signed integer

Definition at line 209 of file SL.h.

◆ SLint32

typedef int32_t SLint32

32 bit signed integer

Definition at line 211 of file SL.h.

◆ SLint64

typedef int64_t SLint64

64 bit signed integer

Definition at line 213 of file SL.h.

◆ SLint8

typedef int8_t SLint8

8 bit signed integer

Definition at line 207 of file SL.h.

◆ SLlong

typedef signed long SLlong

analog to GLlong

Definition at line 191 of file SL.h.

◆ SLshort

typedef short SLshort

analog to GLshort

Definition at line 195 of file SL.h.

◆ SLsizei

typedef int SLsizei

analog to GLsizei

Definition at line 199 of file SL.h.

◆ SLstring

typedef string SLstring

Redefinition of standard types for platform independence.

The SL types mirror the OpenGL types of the same name so that vertex attribute data can be passed to the GL without casting. analog to std::string

Definition at line 185 of file SL.h.

◆ SLubyte

typedef unsigned char SLubyte

analog to GLubyte

Definition at line 194 of file SL.h.

◆ SLuchar

typedef unsigned char SLuchar

analog to GLuchar

Definition at line 190 of file SL.h.

◆ SLuint

typedef unsigned int SLuint

analog to GLuint

Definition at line 198 of file SL.h.

◆ SLuint16

typedef uint16_t SLuint16

16 bit unsigned integer

Definition at line 210 of file SL.h.

◆ SLuint32

typedef uint32_t SLuint32

32 bit unsigned integer

Definition at line 212 of file SL.h.

◆ SLuint64

typedef uint64_t SLuint64

64 bit unsigned integer

Definition at line 214 of file SL.h.

◆ SLuint8

typedef uint8_t SLuint8

8 bit unsigned integer

Definition at line 208 of file SL.h.

◆ SLulong

typedef unsigned long SLulong

analog to GLulong

Definition at line 192 of file SL.h.

◆ SLushort

typedef unsigned short SLushort

analog to GLushort

Definition at line 196 of file SL.h.

◆ SLVbool

typedef vector<SLbool> SLVbool

All 1D vectors begin with SLV*.

Definition at line 217 of file SL.h.

◆ SLVbyte

typedef vector<SLbyte> SLVbyte

Definition at line 218 of file SL.h.

◆ SLVchar

typedef vector<SLchar> SLVchar

Definition at line 220 of file SL.h.

◆ SLVfloat

typedef vector<SLfloat> SLVfloat

Definition at line 228 of file SL.h.

◆ SLVint

typedef vector<SLint> SLVint

Definition at line 224 of file SL.h.

◆ SLVlong

typedef vector<SLlong> SLVlong

Definition at line 226 of file SL.h.

◆ SLVshort

typedef vector<SLshort> SLVshort

Definition at line 222 of file SL.h.

◆ SLVsize_t

typedef vector<size_t> SLVsize_t

Definition at line 230 of file SL.h.

◆ SLVstring

typedef vector<SLstring> SLVstring

Definition at line 229 of file SL.h.

◆ SLVubyte

typedef vector<SLubyte> SLVubyte

Definition at line 219 of file SL.h.

◆ SLVuchar

typedef vector<SLuchar> SLVuchar

Definition at line 221 of file SL.h.

◆ SLVuint

typedef vector<SLuint> SLVuint

Definition at line 225 of file SL.h.

◆ SLVulong

typedef vector<SLulong> SLVulong

Definition at line 227 of file SL.h.

◆ SLVushort

typedef vector<SLushort> SLVushort

Definition at line 223 of file SL.h.

◆ SLVVchar

typedef vector<vector<SLchar> > SLVVchar

Definition at line 237 of file SL.h.

◆ SLVVfloat

typedef vector<vector<SLfloat> > SLVVfloat

All 2D vectors begin with SLVV*.

Definition at line 233 of file SL.h.

◆ SLVVint

typedef vector<vector<SLint> > SLVVint

Definition at line 239 of file SL.h.

◆ SLVVshort

typedef vector<vector<SLshort> > SLVVshort

Definition at line 238 of file SL.h.

◆ SLVVuchar

typedef vector<vector<SLuchar> > SLVVuchar

Definition at line 234 of file SL.h.

◆ SLVVuint

typedef vector<vector<SLuint> > SLVVuint

Definition at line 236 of file SL.h.

◆ SLVVushort

typedef vector<vector<SLushort> > SLVVushort

Definition at line 235 of file SL.h.

◆ SLwstring

typedef std::wstring SLwstring

analog to std::wstring, not available on Android

Definition at line 187 of file SL.h.

Function Documentation

◆ SL_sizeOfVector()

template<class T >
SLuint SL_sizeOfVector ( const T &  vector)
inline

Returns the memory in bytes reserved by a vector.

Note that this reports the capacity, not the size: it is the memory the vector currently occupies, which is what the scene statistics report.

Definition at line 247 of file SL.h.

248 {
249  return (SLint)(vector.capacity() * sizeof(typename T::value_type));
250 }
int SLint
analog to GLint
Definition: SL.h:197