graphic_context_gl1.h

Go to the documentation of this file.
00001 /*
00002 **  ClanLib SDK
00003 **  Copyright (c) 1997-2009 The ClanLib Team
00004 **
00005 **  This software is provided 'as-is', without any express or implied
00006 **  warranty.  In no event will the authors be held liable for any damages
00007 **  arising from the use of this software.
00008 **
00009 **  Permission is granted to anyone to use this software for any purpose,
00010 **  including commercial applications, and to alter it and redistribute it
00011 **  freely, subject to the following restrictions:
00012 **
00013 **  1. The origin of this software must not be misrepresented; you must not
00014 **     claim that you wrote the original software. If you use this software
00015 **     in a product, an acknowledgment in the product documentation would be
00016 **     appreciated but is not required.
00017 **  2. Altered source versions must be plainly marked as such, and must not be
00018 **     misrepresented as being the original software.
00019 **  3. This notice may not be removed or altered from any source distribution.
00020 **
00021 **  Note: Some of the libraries ClanLib may link to may have additional
00022 **  requirements or restrictions.
00023 **
00024 **  File Author(s):
00025 **
00026 **    Mark Page
00027 */
00028 
00031 
00032 #pragma once
00033 
00034 #include "api_gl1.h"
00035 #include "opengl1_defines.h"
00036 #include "../Core/System/sharedptr.h"
00037 #include "../Display/Render/graphic_context.h"
00038 #include "material.h"
00039 #include "light_source.h"
00040 #include "texture_unit.h"
00041 #include "light_model.h"
00042 
00043 class CL_RenderWindowProvider;
00044 class CL_ShaderObjectProvider;
00045 class CL_FrameBufferProvider;
00046 class CL_RenderBufferProvider;
00047 class CL_GL1FrameBufferProvider;
00048 class CL_GraphicContext_GL1_Impl;
00049 
00053 class CL_API_GL1 CL_GraphicContext_GL1 : public CL_GraphicContext
00054 {
00056 public:
00058         CL_GraphicContext_GL1(CL_GraphicContext &gc);
00059 
00060         ~CL_GraphicContext_GL1();
00061 
00063 public:
00064 
00068         int get_max_texture_coords();
00069 
00073         int get_light_count();
00074 
00080         void get_opengl_version(int &version_major, int &version_minor, int &version_release);
00081 
00083 public:
00084 
00088         void push_texture_matrix(int unit_index);
00089 
00094         void set_texture_matrix(int unit_index, const CL_Mat4f &matrix);
00095 
00099         void pop_texture_matrix(int unit_index);
00100 
00104         void set_light_model(const CL_LightModel_GL1 &light_model);
00105 
00107         void reset_light_model();
00108 
00112         void set_material(const CL_Material_GL1 &material);
00113 
00117         void set_front_material(const CL_Material_GL1 &material);
00118 
00122         void set_back_material(const CL_Material_GL1 &material);
00123 
00125         void reset_front_material();
00126 
00128         void reset_back_material();
00129 
00134         void set_material(CLenum face, const CL_Material_GL1 &material);
00135 
00137         void reset_material();
00138 
00142         void set_color_material(CL_ColorMaterial_GL1 color);
00143 
00147         void set_color_material_front(CL_ColorMaterial_GL1 color);
00148 
00152         void set_color_material_back(CL_ColorMaterial_GL1 color);
00153 
00155         void reset_color_material();
00156 
00161         void set_color_material(CLenum face, CL_ColorMaterial_GL1 color);
00162 
00167         void set_light(int light_index, const CL_LightSource_GL1 &light);
00168 
00172         void reset_light(int light_index);
00173 
00178         void set_texture_unit(int unit_index, const CL_TextureUnit_GL1 &unit);
00179 
00183         void set_active();
00184 
00186 private:
00187         CL_SharedPtr<CL_GraphicContext_GL1_Impl> impl;
00188 };
00189 

Generated on Thu Dec 3 02:39:29 2009 for ClanLib by  doxygen 1.4.6