libmoldeo (Moldeo 1.0 Core)  1.0
libmoldeo is the group of objects and functions that executes the basic operations of Moldeo 1.0 Platform.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
moTypes.h
Go to the documentation of this file.
1 /*******************************************************************************
2 
3  moTypes.h
4 
5  ****************************************************************************
6  * *
7  * This source is free software; you can redistribute it and/or modify *
8  * it under the terms of the GNU General Public License as published by *
9  * the Free Software Foundation; either version 2 of the License, or *
10  * (at your option) any later version. *
11  * *
12  * This code is distributed in the hope that it will be useful, but *
13  * WITHOUT ANY WARRANTY; without even the implied warranty of *
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
15  * General Public License for more details. *
16  * *
17  * A copy of the GNU General Public License is available on the World *
18  * Wide Web at <http://www.gnu.org/copyleft/gpl.html>. You can also *
19  * obtain it by writing to the Free Software Foundation, *
20  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
21  * *
22  ****************************************************************************
23 
24  Copyright(C) 2006 Fabricio Costa
25 
26  Authors:
27  Fabricio Costa
28 
29 *******************************************************************************/
30 //types definidos
31 #ifndef __MOTYPES_H
32 #define __MOTYPES_H
33 
34 //para evitar warnings sobre funciones obsoletas
35 #pragma once
36 #define _CRT_SECURE_NO_DEPRECATE 1
37 #define _CRT_NONSTDC_NO_DEPRECATE 1
38 
39 /*OS SELECT*/
40 
41 #if defined(__APPLE__)
42 #undef MO_MACOSX
43 #define MO_MACOSX 1
44 #elif defined(macintosh)
45 #undef MO_MACOS
46 #define MO_MACOS 1
47 #endif
48 
49 #if defined(linux) || defined(__linux) || defined(__linux__)
50 #undef MO_LINUX
51 #define MO_LINUX 1
52 #endif
53 
54 #if defined(WIN32) || defined(_WIN32)
55 #undef MO_WIN32
56 #define MO_WIN32 1
57 #endif
58 
59 /*STANDARD LIBRARIES: define here or die*/
60 #ifdef MO_WIN32
61  #ifndef _MSC_VER
62  //atencion, esto se agregó para evitar el conflicto con freeimage en mingw
63  #define NOGDI //comentar esta línea con MinGW64??
64  //#undef _WINDOWS_
65  #define MO_GSTREAMER
66  #define MO_HANDLE HWND
67  #define MO_DISPLAY void*
68 
69  #endif
70 #endif
71 
72 #undef SHADER_CG
73 
74 
75 #include <math.h>
76 #include <limits.h>
77 #include <iostream>
78 #include <stdio.h>
79 #include <stdlib.h>
80 #include <string.h>
81 #include <float.h>
82 #include <time.h>
83 #include <string>
84 #include <vector>
85 #include <fstream>
86 
87 
88 using namespace std;
89 
90 
91 /*MOLDEO SETUP DEFINITIONS*/
92 
93 #define USE_GL_EXTENSIONS
94 
95 //#define USE_QUICKTIME
96 //#define USE_SDLIMAGE
97 #define USE_FREEIMAGE
98 #define USE_MOTEXT0
99 
100 /*OS DEFINITIONS*/
101 
102 #ifdef MO_WIN32
103  #ifdef LIBMOLDEO_EXPORTS
104  #define LIBMOLDEO_API __declspec(dllexport)
105  #else
106  #define LIBMOLDEO_API __declspec(dllimport)
107  #endif
108 #else
109  #define LIBMOLDEO_API
110 #endif
111 
112 
113 /*OSX*/
114 #ifdef MO_MACOSX
115 
116  //#include <X11/X.h>
117 
118  #define MO_HANDLE void*
119 
120  //revisar esto!!! para Mac OSX
121  #define MO_DISPLAY void*
122 
123 /*
124  #include "SDL.h"
125  #include "SDL_thread.h"
126  #include "SDL_mutex.h"
127  #include "SDL_net.h"
128  #include "SDL_image.h"
129  //#include "QuickTime.h"
130 */
131  #ifdef USE_GL_EXTENSIONS
132  // GLEW provides gl.h, glu.h and glext.h
133  #include <GL/glew.h>
134  #else
135  #include "OpenGL/gl.h"
136  #include "OpenGL/glu.h"
137  #include "OpenGL/glext.h"
138  #endif
139 
140  #include "GLUT/glut.h"
141 
142  #define MO_GSTREAMER 1
143 
144  # ifndef __int64
145  # define __int64 long long
146  # endif
147 
148  # ifndef _int64
149  # define _int64 __int64
150  # endif
151 
152  #define moint64 __int64
153  typedef __int16_t moWord;
154  typedef __int32_t moDWord;
155 
156  //#include <assert.h>
157 #endif
158 
159 /*LINUX*/
160 #ifdef MO_LINUX
161 
162  #include "X11/X.h"
163  #include "X11/Xlib.h"
164  #include "X11/Xutil.h"
165 
166  #define MO_HANDLE Window
167  #define MO_DISPLAY void*
168 
169 /*
170  #include <SDL/SDL.h>
171  #include <SDL/SDL_thread.h>
172  #include <SDL/SDL_mutex.h>
173  #include <SDL/SDL_net.h>
174  #include <SDL/SDL_image.h>
175  #include <SDL/SDL_syswm.h>
176 */
177  #ifdef USE_GL_EXTENSIONS
178  // GLEW provides gl.h, glu.h and glext.h
179  #include <GL/glew.h>
180  #include <GL/glx.h>
181  #else
182  #include <GL/gl.h>
183  #include <GL/glu.h>
184  #include <GL/glext.h>
185  #include <GL/glx.h>
186  #endif
187 
188  #include <GL/glut.h>
189 
190  #define MO_GSTREAMER 1
191 
192  # ifndef __int64
193  # define __int64 long long
194  # endif
195 
196  # ifndef _int64
197  # define _int64 __int64
198  # endif
199 
200  #define moint64 __int64
201  typedef __int16_t moWord;
202  typedef __int32_t moDWord;
203 
204 #endif
205 
206 /*WINDOWS*/
207 #ifdef MO_WIN32
208 
209  /*VISUAL C++ COMPILER*/
210  #ifdef _MSC_VER
211 
212  #define MO_HANDLE HWND
213  #define MO_DISPLAY void*
214 
215  #define MO_USING_VC
216  // Microsoft Visual C++ specific pragmas. MSVC6 is version 12.00, MSVC7.0 is
217  // version 13.00, and MSVC7.1 is version 13.10. MSVC8.0 is version 14.00.
218  #if _MSC_VER < 1300
219  #define MO_USING_VC6
220  #elif _MSC_VER < 1310
221  #define MO_USING_VC70
222  #elif _MSC_VER < 1400
223  #define MO_USING_VC71
224  #else
225  #define MO_USING_VC80
226  #endif
227 
228  // Disable the warning "non dll-interface class FOO used as base for
229  // dll-interface class BAR.".
230  //#pragma warning( disable : 4275 )
231 
232  // Disable the warning about truncating the debug names to 255 characters.
233  // This warning shows up often with STL code in MSVC6, but not MSVC7.
234  #pragma warning( disable : 4786 )
235 
236  // This warning is disabled because MSVC6 warns about not finding
237  // implementations for the pure virtual functions that occur in the template
238  // classes 'template <class Real>' when explicitly instantiating the classes.
239  // NOTE: If you create your own template classes that will be explicitly
240  // instantiated, you should re-enable the warning to make sure that in fact
241  // all your member data and functions have been defined and implemented.
242  #pragma warning( disable : 4661 )
243 
244  #define MO_DIRECTSHOW
245  #endif
246 
247  #define WIN32_LEAN_AND_MEAN
248  #include <windows.h>
249 /*
250  #include <SDL.h>
251  #include <SDL_thread.h>
252  #include <SDL_mutex.h>
253  #include <SDL_syswm.h>
254 */
255  #ifdef USE_QUICKTIME
256  //#define TARGET_API_MAC_CARBON 0
257  //#define TARGET_OS_WIN32 1
258  //#define TARGET_CPU_X86 1
259  //#define FUNCTION_DECLSPEC 1
260  //#define FUNCTION_WIN32CC 1
261  //#define PHYSICAL_ADDRESS LARGE_INTEGER
262  #endif
263 
264  #ifdef USE_GL_EXTENSIONS
265  // GLEW provides gl.h, glu.h and glext.h
266  #include <GL/glew.h>
267  #else
268  #include "GL/gl.h"
269  #include "GL/glu.h"
270  #include "GL/glext.h"
271  #endif
272 
273  #include "GL/glut.h"
274 
275  //basetyps.h
276  # ifndef _int64
277  # define _int64 __int64
278  # endif
279 
280  #define moint64 __int64
281  typedef __int16 moWord;
282  typedef __int32 moDWord;
283 
284  //#define assert(X) {}
285 #endif
286 
287 
288 
289 /*CONSTANTS DEFINITIONS*/
290 #define MO_PI 3.1415926535897932384626433832795f
291 #define MO_ON 1
292 #define MO_OFF -1
293 #define MO_ACTIVATED 1
294 #define MO_DEACTIVATED -1
295 #define MO_FALSE 0
296 #define MO_TRUE 1
297 #define MO_PRESSED 1
298 #define MO_PULSED 1
299 #define MO_RELEASED 0
300 
301 #define MO_SUCCESS 0
302 #define MO_NOERROR 0
303 #define MO_ERROR 65535
304 #define MO_FAIL 65535
305 #define MO_UNDEFINED -1
306 
307 #define MO_MAX_DEBUG 4096
308 #define MO_MAX_TEXTURAS 512
309 #define MO_MAX_MODELOS 256
310 
311 #define MOboolean GLuint
312 #define MOswitch signed char
313 #define MOuint GLuint
314 #define MOint GLint
315 #define MOint64 moint64
316 #define MOuint64 unsigned moint64
317 #define MOlong long
318 #define MOulong unsigned long
319 #define MOlonglong moint64
320 #define MOulonglong unsigned moint64
321 #define MOword moWord
322 #define MOdword moDWord
323 #define MOchar char
324 #define MOuchar unsigned char
325 #define MOubyte unsigned char
326 #define MObyte char
327 #define MOshort short
328 #define MOushort unsigned short
329 #define MOfloat GLfloat
330 #define MOdouble GLdouble
331 #define MOtexture GLuint
332 #define MOefectoid GLuint
333 
334 
335 #define MOpointer void*
336 
337 #define MOaccion int
338 #define MOdevcode int
339 
340 #define MO_DEF_SCREEN_WIDTH 800
341 #define MO_DEF_SCREEN_HEIGHT 600
342 #define MO_DEF_RENDER_WIDTH 800
343 #define MO_DEF_RENDER_HEIGHT 600
344 #define MO_DEF_SCREEN_DEPTH 32
345 
346 #define MO_RENDER_TEX 0
347 #define MO_SCREEN_TEX 1
348 #define MO_EFFECTS_TEX 2
349 #define MO_FINAL_TEX 3
350 
351 //3D STEREOSCOPIC RENDER
352 #define MO_LEFT_TEX 4
353 #define MO_RIGHT_TEX 5
354 
355 
356 #define MO_MAX_PRESETS 9
357 #define MO_DEBUG
358 
359 #define OLD_CONFIG 0
360 
361 
363 // Parametros mas comunes usados en varios Effects ///
365 
366 #ifndef MO_RED
367 #define MO_RED 0
368 #define MO_GREEN 1
369 #define MO_BLUE 2
370 #define MO_ALPHA 3
371 #endif
372 
374 
390 };
391 
393 
403 };
404 
406 
414 };
415 
417 
419 // Linux compatibility ///
421 
422 #ifdef MO_LINUX
423 # include "moPort.h"
424 #endif
425 
426 #ifdef MO_MACOSX
427 # include "moPort.h"
428 #endif
429 
431 
434 LIBMOLDEO_API void HSVtoRGB(short,short,short,float*,float*,float*);
435 
437 
451 };
452 
454 
459 struct LIBMOLDEO_API moTexParam {
460  public:
461  GLenum target;
462  GLint internal_format;
463  GLint min_filter;
464  GLint mag_filter;
465  GLint wrap_s;
466  GLint wrap_t;
467 };
468 
469 
471 
479 {
480  GL_TEXTURE_2D,
481  GL_RGBA,
482  GL_LINEAR,
483  GL_LINEAR,
484  GL_REPEAT,
485  GL_REPEAT
486 };
487 
488 
490 
497 {
498  MO_UNDEFINED,
499  MO_UNDEFINED,
500  MO_UNDEFINED,
501  MO_UNDEFINED,
502  MO_UNDEFINED,
503  MO_UNDEFINED
504 };
505 
506 
508 
511 #include "moText.h"
513 
515 
518 #ifndef momax
519 #define momax(a,b) (((a) > (b)) ? (a) : (b))
520 #define momin(a,b) (((a) < (b)) ? (a) : (b))
521 #endif
522 
523 #endif
524 
Parámetros internos de una textura.
Definition: moTypes.h:543
moMoldeoObjectType
Tipos de objetos en Moldeo.
Definition: moTypes.h:525
sólo líneas
Definition: moTypes.h:475
aditivo por color
Definition: moTypes.h:460
moStereoSides
Modo estereoscópico.
Definition: moTypes.h:484
sustracción
Definition: moTypes.h:462
LIBMOLDEO_API MOint moRand(MOint)
Definition: moTypes.cpp:41
Recursos de datos, objetos, imágenes, videos y funcionalidades múltiples.
Definition: moTypes.h:533
LIBMOLDEO_API moText moGetVersionStr()
Devuelve la versión de libmoldeo.
Definition: moTypes.cpp:159
Objeto dibujable, efecto-maestro ( puede controlar otros efectos )
Definition: moTypes.h:531
const moTexParam MODefTex2DParams
Parámetros internos predeterminados de una textura.
Definition: moTypes.h:562
saturación
Definition: moTypes.h:463
Objeto indefinido.
Definition: moTypes.h:527
clase de para manejar textos
Definition: moText.h:75
aditivo según transparencia
Definition: moTypes.h:456
Dispositivo de entrada/salida, típicamente, interfaces humanas de IO y datos ( teclado, mouse, tableta, tcp, udp, serial )
Definition: moTypes.h:532
LIBMOLDEO_API MOfloat morand()
Definition: moTypes.cpp:36
#define MOfloat
Definition: moTypes.h:329
#define MOint
Definition: moTypes.h:314
Objeto dibujable, pre-efecto ( primeros efectos en el orden de dibujado )
Definition: moTypes.h:529
Objeto dibujable, efecto ( efectos en el orden de dibujado )
Definition: moTypes.h:528
multipliación
Definition: moTypes.h:458
#define LIBMOLDEO_API
Definition: moTypes.h:109
const moTexParam MOUndefinedTex
Parámetros internos predeterminados de una textura no identificados.
Definition: moTypes.h:580
Objeto principal de administración y dibujado de objetos de Moldeo.
Definition: moTypes.h:534
transparencia
Definition: moTypes.h:455
sólo puntos
Definition: moTypes.h:476
LIBMOLDEO_API void HSVtoRGB(short, short, short, float *, float *, float *)
Definition: moTypes.cpp:51
Objeto dibujable, post-efecto ( últímos efectos en el orden de dibujado )
Definition: moTypes.h:530
exclusión
Definition: moTypes.h:459
#define MO_UNDEFINED
Definition: moTypes.h:305
moPolygonModes
Modos de dibujado de polígonos.
Definition: moTypes.h:472
moBlendingModes
Modos de combinación
Definition: moTypes.h:453