Welcome to mirror list, hosted at ThFree Co, Russian Federation.

ImageRender.h « VideoTexture « gameengine « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 66255f04d2c152fd0bd4c2e2653e1ee57601350f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/* $Id$
-----------------------------------------------------------------------------
This source file is part of VideoTexture library

Copyright (c) 2007 The Zdeno Ash Miklas

This program 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 of the License, or (at your option) any later
version.

This program 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 program; if not, write to the Free Software Foundation, Inc., 59 Temple
Place - Suite 330, Boston, MA 02111-1307, USA, or go to
http://www.gnu.org/copyleft/lesser.txt.
-----------------------------------------------------------------------------
*/

#if !defined IMAGERENDER_H
#define IMAGERENDER_H


#include "Common.h"

#include <KX_Scene.h>
#include <KX_Camera.h>
#include <DNA_screen_types.h>
#include <RAS_ICanvas.h>
#include <RAS_IRasterizer.h>
#include <RAS_IRenderTools.h>

#include "ImageViewport.h"


/// class for render 3d scene
class ImageRender : public ImageViewport
{
public:
	/// constructor
	ImageRender (KX_Scene * scene, KX_Camera * camera);

	/// destructor
	virtual ~ImageRender (void);

	/// get background color
	unsigned char * getBackground (void) { return m_background; }
	/// set background color
	void setBackground (unsigned char red, unsigned char green, unsigned char blue);

protected:
	/// rendered scene
	KX_Scene * m_scene;
	/// camera for render
	KX_Camera * m_camera;

	/// screen area for rendering
	ScrArea m_area;
	/// rendering device
	RAS_ICanvas * m_canvas;
	/// rasterizer
	RAS_IRasterizer * m_rasterizer;
	/// render tools
	RAS_IRenderTools * m_rendertools;

	/// background colour
	unsigned char m_background[3];


	/// render 3d scene to image
	virtual void calcImage (unsigned int texId);

	/// refresh lights
	void refreshLights (void);
	/// methods from KX_KetsjiEngine
	bool BeginFrame();
	void EndFrame();
	void Render();
	void SetupRenderFrame(KX_Scene *scene, KX_Camera* cam);
	void RenderFrame(KX_Scene* scene, KX_Camera* cam);
	void SetBackGround(KX_WorldInfo* wi);
	void SetWorldSettings(KX_WorldInfo* wi);
};


#endif