iCub-main
rendering.h
Go to the documentation of this file.
1 // -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*-
2 
3 /*
4 * Copyright (C) 2010 RobotCub Consortium, European Commission FP6 Project IST-004370
5 * Author: Vadim Tikhanoff
6 * email: vadim.tikhanoff@iit.it
7 * website: www.robotcub.org
8 * Permission is granted to copy, distribute, and/or modify this program
9 * under the terms of the GNU General Public License, version 2 or any
10 * later version published by the Free Software Foundation.
11 *
12 * A copy of the license can be found at
13 * http://www.robotcub.org/icub/license/gpl.txt
14 *
15 * This program is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
18 * Public License for more details
19 */
20 
30 #include "SDL.h"
31 #include "SDL_opengl.h"
32 #include <ode/ode.h>
33 #include "VideoTexture.h"
34 #include <yarp/os/ResourceFinder.h>
35 #include "xloader.h"
36 #include <iostream>
37 # include <stdio.h>
38 using std::cout;
39 using std::endl;
40 #ifndef __RENDERING_H__
41 #define __RENDERING_H__
42 #define FLOOR 0
43 
44 typedef struct /**** BMP file info structure ****/
45  {
46  unsigned int biSize; /* Size of info header */
47  int biWidth; /* Width of image */
48  int biHeight; /* Height of image */
49  unsigned short biPlanes; /* Number of color planes */
50  unsigned short biBitCount; /* Number of bits per pixel */
51  unsigned int biCompression; /* Type of compression to use */
52  unsigned int biSizeImage; /* Size of image data */
53  int biXPelsPerMeter; /* X pixels per meter */
54  int biYPelsPerMeter; /* Y pixels per meter */
55  unsigned int biClrUsed; /* Number of colors used */
56  unsigned int biClrImportant; /* Number of important colors */
57  char *data;
59 
60 typedef struct vector_s
61 {
62  float x,
63  y,
64  z;
65 } vector_t;
66 
67 typedef struct vertex_s
68 {
69  float x,
70  y,
71  z;
72 } vertex_t;
73 
74 extern unsigned int Texture[200];
75 
76 void setupTexture(char *filename, int whichtexture);
77 bool setup_opengl(yarp::os::ResourceFinder& finder);
79 void DrawGround(bool wireframe);
80 void DrawBox(float length, float height, float width, bool wireframe, bool texture, int whichtexture);
81 void DrawSphere(float radius, bool wireframe, bool texture,int whichtexture);
82 void DrawCylinder(float radius, float length, bool wireframe, bool texture,int whichtexture);
83 void LDEsetM(const dReal *pos,const dReal *R);
84 GLuint LoadTextureRAW( const char * filename, int wrap );
85 void drawSkyDome(float x, float y, float z, float width, float height, float length);
86 void DrawX (dTriMeshX trimesh, int whichtexture);
87 int LoadBitmapTERMINAL(char *filename, int whichtexture);
88 
89 
90 #endif
91 
92 
void drawSkyDome(float x, float y, float z, float width, float height, float length)
Definition: rendering.cpp:159
unsigned int biClrImportant
Definition: rendering.h:56
bool setup_opengl(yarp::os::ResourceFinder &finder)
Definition: rendering.cpp:64
void setupTexture(char *filename, int whichtexture)
Definition: rendering.cpp:504
unsigned int biSize
Definition: rendering.h:46
static VideoTexture * video
Definition: iCub_Sim.cpp:82
float z
Definition: rendering.h:62
const dReal * pos
Definition: iCub_Sim.cpp:62
Header file for the video stream texture.
void DrawX(dTriMeshX trimesh, int whichtexture)
Definition: rendering.cpp:461
void DrawGround(bool wireframe)
Definition: rendering.cpp:122
unsigned int biCompression
Definition: rendering.h:51
static int width
Definition: iCub_Sim.cpp:53
GLuint LoadTextureRAW(const char *filename, int wrap)
Definition: rendering.cpp:421
float x
Definition: rendering.h:62
float z
Definition: rendering.h:69
void LDEsetM(const dReal *pos, const dReal *R)
Definition: rendering.cpp:400
static int height
Definition: iCub_Sim.cpp:54
unsigned short biBitCount
Definition: rendering.h:50
struct vector_s vector_t
void DrawBox(float length, float height, float width, bool wireframe, bool texture, int whichtexture)
Definition: rendering.cpp:226
float y
Definition: rendering.h:62
Header for the 3D x loader.
unsigned int biSizeImage
Definition: rendering.h:52
struct vertex_s vertex_t
void DrawSphere(float radius, bool wireframe, bool texture, int whichtexture)
Definition: rendering.cpp:329
void DrawCylinder(float radius, float length, bool wireframe, bool texture, int whichtexture)
Definition: rendering.cpp:353
unsigned short biPlanes
Definition: rendering.h:49
void DrawVideo(VideoTexture *video)
Definition: rendering.cpp:456
int LoadBitmapTERMINAL(char *filename, int whichtexture)
Definition: rendering.cpp:509
unsigned int Texture[200]
Definition: rendering.cpp:53
unsigned int biClrUsed
Definition: rendering.h:55