Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members Related Pages

# GraphicsDeviceI.h

    00001 //-------------------------------------------------------------------------
    00002 //
    00003 // File:        GraphicsDeviceI.h
    00004 // Desc:        Graphics device interface.
    00005 // Author:      memon <memon@inside.org>
    00006 //
    00007 //-------------------------------------------------------------------------
    00008 //  Copyright (c) 2000-2002 Moppi Productions. All Rights Reserved.
    00009 //  This file is part of Moppi Demopaja SDK. For conditions of
    00010 //  distribution and use, see the accompanying license.txt file.
    00011 //  http://moppi.inside.org/demopaja/
    00012 //-------------------------------------------------------------------------
    00013
    00014 #ifndef __DEMOPAJA_GRAPHICSDEVICEI_H__
    00015 #define __DEMOPAJA_GRAPHICSDEVICEI_H__
    00016
    00017 #define WIN32_LEAN_AND_MEAN
    00018 #include <windows.h>
    00019
    00020 // Forward declaration
    00021 namespace PajaSystem {
    00022     class GraphicsDeviceI;
    00023 };
    00024
    00025 #include "PajaTypes.h"
    00026 #include "ColorC.h"
    00027 #include "DeviceInterfaceI.h"
    00028 #include "DataBlockI.h"
    00029 #include "ClassIdC.h"
    00030 #include "DeviceFeedbackC.h"
    00031 #include "GraphicsBufferI.h"
    00032
    00033 namespace PajaSystem {
    00034
    00035     #define DP_END_PREVIEW      (WM_APP + 110)
    00036
    00038     const PluginClass::SuperClassIdC        SUPERCLASS_GRAPHICSDEVICE = PluginClass::SuperClassIdC( 0, 0x3000001 );
    00039
    00040
    00042     enum GDeviceCreateFlagsE {
    00043         GRAPHICSDEVICE_CREATE_EDITOR_CHILD = 1,
    00044         GRAPHICSDEVICE_CREATE_WINDOWED,
    00045         GRAPHICSDEVICE_CREATE_FULLSCREEN,
    00046         GRAPHICSDEVICE_CREATE_CHILD,
    00047     };
    00048
    00050     enum GDeviceClearFlagsE {
    00051         GRAPHICSDEVICE_COLORBUFFER =    0x01,
    00052         GRAPHICSDEVICE_DEPTHBUFFER =    0x02,
    00053         GRAPHICSDEVICE_STENCILBUFFER =  0x04,
    00054         GRAPHICSDEVICE_ACCUMBUFFER =    0x08,
    00055         GRAPHICSDEVICE_ALLBUFFERS =     0x0f,
    00056     };
    00057
    00059
    00061     class GraphicsDeviceI : public DeviceInterfaceI
    00062     {
    00063     public:
    00065         virtual Edit::DataBlockI*               create() = 0;
    00066
    00068         virtual PluginClass::SuperClassIdC      get_super_class_id() const;
    00070
    00073         virtual bool                            get_exclusive() const;
    00074
    00076         virtual bool                            init( HINSTANCE hInstance, HWND hParent,
    00077                                                     PajaTypes::int32 i32ID, PajaTypes::uint32 ui32Flags,
    00078                                                     PajaTypes::uint32 ui32Width = 0, PajaTypes::uint32 ui32Height = 0,
    00079                                                     PajaTypes::uint32 ui32BPP = 0,
    00080                                                     PajaSystem::DeviceFeedbackC* pFeedback = 0 ) = 0;
    00082         virtual void                            destroy() = 0;
    00084         virtual void                            flush() = 0;
    00086         virtual void                            activate() = 0;
    00088         virtual HWND                            get_hwnd() = 0;
    00090         virtual bool                            configure() = 0;
    00091
    00093         virtual bool                            set_fullscreen( PajaTypes::uint32 ui32Width, PajaTypes::uint32 ui32Height,
    00094                                                     PajaTypes::uint32 ui32BPP = 0 ) = 0;
    00096         virtual bool                            set_windowed() = 0;
    00097
    00099         virtual void                            clear_device( PajaTypes::uint32 ui32Flags,
    00100                                                     const PajaTypes::ColorC& rColor = PajaTypes::ColorC(),
    00101                                                     PajaTypes::float32 f32Depth = 1.0f, PajaTypes::int32 i32Stencil = 0 ) = 0;
    00102
    00104         virtual void                            begin_draw() = 0;
    00106         virtual void                            end_draw() = 0;
    00107
    00109         virtual void                            begin_effects() = 0;
    00111         virtual void                            end_effects() = 0;
    00112
    00114         virtual void                            set_size( PajaTypes::int32 int32X, PajaTypes::int32 int32Y,
    00115                                                     PajaTypes::int32 i32Width, PajaTypes::int32 i32Height ) = 0;
    00116
    00118
    00121         virtual GraphicsBufferI*                create_graphicsbuffer() = 0;
    00122
    00124
    00130         virtual GraphicsBufferI*                set_render_target( GraphicsBufferI* pBuffer ) = 0;
    00131
    00132     protected:
    00133         GraphicsDeviceI();
    00134         virtual ~GraphicsDeviceI();
    00135
    00136     };
    00137
    00138 };
    00139
    00140 #endif // __DEMOPAJA_GRAPHICSDEVICEI_H__