Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

target_ggi_put.cpp

Go to the documentation of this file.
00001 /*
00002         $Id: target_ggi_put.cpp,v 1.2 2001/03/17 23:53:24 vaidhy Exp $
00003 
00004         ------------------------------------------------------------------------
00005         ClanLib, the platform independent game SDK.
00006 
00007         This library is distributed under the GNU LIBRARY GENERAL PUBLIC LICENSE
00008         version 2. See COPYING for details.
00009 
00010         For a total list of contributers see CREDITS.
00011 
00012         ------------------------------------------------------------------------
00013 */
00014 
00015 #include "Core/precomp.h"
00016 
00017 #ifdef USE_GGI
00018 
00019 #include <API/Display/Display/palette.h>
00020 #include <Display/Display/GGI/target_ggi.h>
00021 #include <Display/Display/GGI/target_ggi_put.h>
00022 #include "API/Core/System/cl_assert.h"
00023 #include "Core/System/Generic/string_asm.h"
00024 
00025 #include <iostream>
00026 #include <string.h>
00027 #include <math.h>
00028 #include <sys/mman.h>
00029 
00030 CL_Target_GGI_Put::CL_Target_GGI_Put(ggi_visual_t vis) : CL_Target_GGI(vis)
00031 {
00032         m_pixelformat = ggiGetPixelFormat(m_vis);
00033 
00034         image_size = m_mode.virt.x * m_mode.virt.y * GT_DEPTH(m_mode.graphtype);
00035         image_data = new char[image_size];
00036 }
00037 
00038 CL_Target_GGI_Put::~CL_Target_GGI_Put()
00039 {
00040         delete ((char*) image_data);
00041 }
00042 
00043 void CL_Target_GGI_Put::lock()
00044 {
00045 //      return image_data!=NULL;
00046 }
00047         
00048 void CL_Target_GGI_Put::unlock()
00049 {
00050 }
00051 
00052 void *CL_Target_GGI_Put::get_data() const
00053 {
00054         return image_data;
00055 }
00056 
00057 void CL_Target_GGI_Put::to_front()
00058 {
00059         ggiPutBox( m_vis, 0, 0, m_mode.virt.x, m_mode.virt.x, image_data );
00060         ggiFlush( m_vis );
00061 }
00062 
00063 void CL_Target_GGI_Put::to_back()
00064 {
00065 }
00066 
00067 unsigned int CL_Target_GGI_Put::get_width() const
00068 {
00069         return m_mode.virt.x;
00070 }
00071 
00072 unsigned int CL_Target_GGI_Put::get_height() const
00073 {
00074         return m_mode.virt.y;
00075 }
00076 
00077 unsigned int CL_Target_GGI_Put::get_pitch() const
00078 {
00079         return m_mode.virt.x * ((get_depth()+7)/8);
00080 }
00081 
00082 unsigned int CL_Target_GGI_Put::get_depth() const
00083 {
00084         return GT_DEPTH(m_mode.graphtype);
00085 }
00086 
00087 unsigned int CL_Target_GGI_Put::get_red_mask() const
00088 {
00089         return m_pixelformat->red_mask;
00090 }
00091 
00092 unsigned int CL_Target_GGI_Put::get_green_mask() const
00093 {
00094         return m_pixelformat->green_mask;
00095 }
00096 
00097 unsigned int CL_Target_GGI_Put::get_blue_mask() const
00098 {
00099         return m_pixelformat->blue_mask;
00100 }
00101 
00102 unsigned int CL_Target_GGI_Put::get_alpha_mask() const
00103 {
00104         return m_pixelformat->alpha_mask;
00105 }
00106 
00107 CL_Palette *CL_Target_GGI_Put::get_palette() const
00108 {
00109         return (CL_Palette *) &m_palette;
00110 }
00111 
00112 #endif

Generated at Wed Apr 4 19:54:04 2001 for ClanLib by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001