2006-04-02 14:20:45 +00:00
|
|
|
/* Residual - Virtual machine to run LucasArts' 3D adventure games
|
|
|
|
* Copyright (C) 2003-2006 The ScummVM-Residual Team (www.scummvm.org)
|
|
|
|
*
|
|
|
|
* 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 Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*
|
|
|
|
* $URL$
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
*/
|
2005-01-12 18:06:43 +00:00
|
|
|
|
|
|
|
#ifndef DRIVER_TINYGL_H
|
|
|
|
#define DRIVER_TINYGL_H
|
|
|
|
|
|
|
|
#include "bits.h"
|
|
|
|
#include "vector3d.h"
|
|
|
|
#include "color.h"
|
|
|
|
#include "model.h"
|
|
|
|
#include "colormap.h"
|
|
|
|
#include "bitmap.h"
|
|
|
|
#include "driver.h"
|
2006-02-05 17:19:44 +00:00
|
|
|
#include "driver_sdl.h"
|
2005-01-12 18:06:43 +00:00
|
|
|
|
|
|
|
#include "tinygl/gl.h"
|
|
|
|
#include "tinygl/zgl.h"
|
|
|
|
|
|
|
|
#include <SDL.h>
|
|
|
|
|
2006-02-05 17:19:44 +00:00
|
|
|
class DriverTinyGL : public DriverSDL {
|
2005-01-12 18:06:43 +00:00
|
|
|
public:
|
2005-03-28 01:54:21 +00:00
|
|
|
DriverTinyGL(int screenW, int screenH, int screenBPP, bool fullscreen = false);
|
2005-01-12 23:28:47 +00:00
|
|
|
virtual ~DriverTinyGL();
|
2005-01-12 18:06:43 +00:00
|
|
|
|
|
|
|
void setupCamera(float fov, float nclip, float fclip, float roll);
|
|
|
|
void positionCamera(Vector3d pos, Vector3d interest);
|
|
|
|
|
2005-03-28 01:54:21 +00:00
|
|
|
void toggleFullscreenMode();
|
2005-01-12 18:06:43 +00:00
|
|
|
void clearScreen();
|
|
|
|
void flipBuffer();
|
|
|
|
|
2005-04-07 20:06:27 +00:00
|
|
|
bool isHardwareAccelerated();
|
|
|
|
|
2005-01-12 18:06:43 +00:00
|
|
|
void startActorDraw(Vector3d pos, float yaw, float pitch, float roll);
|
|
|
|
void finishActorDraw();
|
2007-03-12 21:50:44 +00:00
|
|
|
void setupShadower(Shadow *shadow);
|
2005-01-12 18:06:43 +00:00
|
|
|
|
|
|
|
void set3DMode();
|
|
|
|
|
2006-01-05 02:40:26 +00:00
|
|
|
void translateViewpoint(Vector3d pos, float pitch, float yaw, float roll);
|
|
|
|
void translateViewpoint();
|
|
|
|
|
2005-01-12 18:06:43 +00:00
|
|
|
void drawHierachyNode(const Model::HierNode *node);
|
|
|
|
void drawModelFace(const Model::Face *face, float *vertices, float *vertNormals, float *textureVerts);
|
|
|
|
|
2005-01-18 17:25:04 +00:00
|
|
|
void disableLights();
|
|
|
|
void setupLight(Scene::Light *light, int lightId);
|
|
|
|
|
2005-01-12 18:06:43 +00:00
|
|
|
void createMaterial(Material *material, const char *data, const CMap *cmap);
|
|
|
|
void selectMaterial(const Material *material);
|
|
|
|
void destroyMaterial(Material *material);
|
|
|
|
|
|
|
|
void createBitmap(Bitmap *bitmap);
|
|
|
|
void drawBitmap(const Bitmap *bitmap);
|
|
|
|
void destroyBitmap(Bitmap *bitmap);
|
|
|
|
|
|
|
|
void drawDepthBitmap(int x, int y, int w, int h, char *data);
|
|
|
|
void drawBitmap();
|
2005-08-28 23:25:14 +00:00
|
|
|
void dimScreen();
|
|
|
|
void dimRegion(int x, int y, int w, int h, float level);
|
2005-01-12 18:06:43 +00:00
|
|
|
|
2005-04-08 18:29:13 +00:00
|
|
|
Bitmap *getScreenshot(int w, int h);
|
2005-08-13 11:33:12 +00:00
|
|
|
void storeDisplay();
|
2005-08-13 20:14:46 +00:00
|
|
|
void copyStoredToDisplay();
|
2005-04-07 07:04:36 +00:00
|
|
|
|
2005-01-12 18:06:43 +00:00
|
|
|
void drawEmergString(int x, int y, const char *text, const Color &fgColor);
|
|
|
|
void loadEmergFont();
|
2005-03-20 14:03:08 +00:00
|
|
|
TextObjectHandle *createTextBitmap(uint8 *bitmap, int width, int height, const Color &fgColor);
|
2005-03-19 21:48:23 +00:00
|
|
|
void drawTextBitmap(int x, int y, TextObjectHandle *handle);
|
2005-03-20 13:51:40 +00:00
|
|
|
void destroyTextBitmap(TextObjectHandle *handle);
|
2005-01-12 18:06:43 +00:00
|
|
|
|
2005-04-07 19:29:06 +00:00
|
|
|
void drawRectangle(PrimitiveObject *primitive);
|
2005-05-05 21:23:17 +00:00
|
|
|
void drawLine(PrimitiveObject *primitive);
|
2007-01-30 12:38:26 +00:00
|
|
|
void drawPolygon(PrimitiveObject *primitive);
|
2005-04-07 19:29:06 +00:00
|
|
|
|
2005-01-12 18:06:43 +00:00
|
|
|
void prepareSmushFrame(int width, int height, byte *bitmap);
|
|
|
|
void drawSmushFrame(int offsetX, int offsetY);
|
|
|
|
|
2005-04-07 07:04:36 +00:00
|
|
|
protected:
|
|
|
|
|
2005-01-12 18:06:43 +00:00
|
|
|
private:
|
|
|
|
ZBuffer *_zb;
|
|
|
|
SDL_Surface *_screen;
|
2005-08-10 14:45:23 +00:00
|
|
|
byte *_smushBitmap;
|
2005-01-12 18:06:43 +00:00
|
|
|
int _smushWidth;
|
|
|
|
int _smushHeight;
|
2005-08-13 20:14:46 +00:00
|
|
|
byte *_storedDisplay;
|
2005-01-12 18:06:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|