Cinder  0.8.6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RendererDx.h
Go to the documentation of this file.
1 /*
2  Copyright (c) 2012, The Cinder Project, All rights reserved.
3  Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
4 
5  This code is intended for use with the Cinder C++ library: http://libcinder.org
6 
7  Redistribution and use in source and binary forms, with or without modification, are permitted provided that
8  the following conditions are met:
9 
10  * Redistributions of source code must retain the above copyright notice, this list of conditions and
11  the following disclaimer.
12  * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
13  the following disclaimer in the documentation and/or other materials provided with the distribution.
14 
15  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
16  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
17  PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
18  ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
19  TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
21  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
22  POSSIBILITY OF SUCH DAMAGE.
23 */
24 
25 #pragma once
26 
27 #include "cinder/app/Renderer.h"
28 
29 namespace cinder { namespace app {
30 
31 typedef std::shared_ptr<class RendererDx> RendererDxRef;
32 class RendererDx : public Renderer {
33  public:
34  RendererDx( int aAntiAliasing = AA_MSAA_16 );
35  ~RendererDx();
36 
37  static RendererDxRef create( int antiAliasing = AA_MSAA_16 ) { return RendererDxRef( new RendererDx( antiAliasing ) ); }
38  virtual RendererRef clone() const { return RendererDxRef( new RendererDx( *this ) ); }
39  virtual RendererType getRendererType() const override { return RENDERER_DX; }
40 
41 #if defined ( CINDER_MSW )
42  virtual void setup( App *aApp, HWND wnd, HDC dc, RendererRef sharedRenderer );
43  virtual HWND getHwnd() { return mWnd; }
44 #elif defined( CINDER_WINRT )
45  virtual void setup( App *aApp, DX_WINDOW_TYPE wnd);
46 #endif
47 
48  virtual void kill();
49  virtual void prepareToggleFullScreen();
50  virtual void finishToggleFullScreen();
51 
53  static const int sAntiAliasingSamples[];
54  void setAntiAliasing( int aAntiAliasing );
55  int getAntiAliasing() const { return mAntiAliasing; }
56 
57  virtual void startDraw();
58  virtual void finishDraw();
59  virtual void defaultResize();
60  virtual Surface copyWindowSurface( const Area &area );
61  virtual void makeCurrentContext();
62 
65 
67 
68  protected:
69  RendererDx( const RendererDx &renderer );
70 
72  DX_WINDOW_TYPE mWnd;
75 };
76 
77 } } // namespace cinder::app
int mAntiAliasing
Definition: RendererDx.h:71
RendererDx(int aAntiAliasing=AA_MSAA_16)
Definition: RendererDx.cpp:36
Definition: RendererDx.h:52
Definition: Area.h:37
virtual void prepareToggleFullScreen()
Definition: RendererDx.cpp:79
RendererType
Definition: Renderer.h:90
MatrixStack mProjection
Definition: RendererDx.h:74
Definition: Renderer.h:88
class AppImplMswRendererDx * mImpl
Definition: RendererDx.h:66
void setAntiAliasing(int aAntiAliasing)
std::shared_ptr< class RendererDx > RendererDxRef
Definition: RendererDx.h:31
Definition: MatrixStack.h:9
virtual Surface copyWindowSurface(const Area &area)
Definition: RendererDx.cpp:104
virtual void makeCurrentContext()
Definition: RendererDx.cpp:155
~RendererDx()
Definition: RendererDx.cpp:45
Definition: RendererDx.h:52
int getAntiAliasing() const
Definition: RendererDx.h:55
virtual void kill()
Definition: RendererDx.cpp:74
virtual void defaultResize()
Definition: RendererDx.cpp:99
Definition: App.h:127
DX_WINDOW_TYPE mWnd
Definition: RendererDx.h:72
MatrixStack & getProjection()
Definition: RendererDx.h:64
Definition: RendererDx.h:52
static RendererDxRef create(int antiAliasing=AA_MSAA_16)
Definition: RendererDx.h:37
std::shared_ptr< class Renderer > RendererRef
Definition: Renderer.h:85
static const int sAntiAliasingSamples[]
Definition: RendererDx.h:53
virtual void startDraw()
Definition: RendererDx.cpp:89
MatrixStack mModelView
Definition: RendererDx.h:73
Definition: RendererDx.h:52
virtual void finishToggleFullScreen()
Definition: RendererDx.cpp:84
virtual RendererType getRendererType() const override
Definition: RendererDx.h:39
MatrixStack & getModelView()
Definition: RendererDx.h:63
Definition: RendererDx.h:52
virtual void finishDraw()
Definition: RendererDx.cpp:94
Definition: Renderer.h:93
Definition: RendererDx.h:52
Definition: RendererDx.h:32
Definition: AppImplMswRendererDx.h:48
virtual RendererRef clone() const
Definition: RendererDx.h:38
Definition: RendererDx.h:52