Cinder  0.8.6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
AppImplMswRendererGdi.h
Go to the documentation of this file.
1 /*
2  Copyright (c) 2012, The Cinder Project, All rights reserved.
3 
4  This code is intended for use with the Cinder C++ library: http://libcinder.org
5 
6  Redistribution and use in source and binary forms, with or without modification, are permitted provided that
7  the following conditions are met:
8 
9  * Redistributions of source code must retain the above copyright notice, this list of conditions and
10  the following disclaimer.
11  * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
12  the following disclaimer in the documentation and/or other materials provided with the distribution.
13 
14  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
15  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
16  PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
17  ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
18  TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
19  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
20  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
21  POSSIBILITY OF SUCH DAMAGE.
22 */
23 
24 #pragma once
25 
26 #include <windows.h>
27 #undef min
28 #undef max
29 
31 #include "cinder/Surface.h"
32 
33 namespace cinder { namespace app {
34 
35 class App;
36 
38  public:
39  AppImplMswRendererGdi( App *aApp, bool doubleBuffer );
40 
41  virtual bool initialize( HWND wnd, HDC dc, RendererRef sharedRenderer );
42  virtual void kill() {}
43  virtual void defaultResize() const;
44  virtual void swapBuffers() const;
45  virtual void makeCurrentContext();
46 
47  virtual HDC getDc() const { return ( mDoubleBuffer ) ? mDoubleBufferDc : mPaintDc; }
48  Surface8u copyWindowContents( const Area &area );
49 
50  protected:
51  ::HDC mPaintDc;
52  ::PAINTSTRUCT mPaintStruct;
53 
58 };
59 
60 } } // namespace cinder::app
Definition: AppImplMswRenderer.h:37
virtual void makeCurrentContext()
Definition: AppImplMswRendererGdi.cpp:56
Vec2i mDoubleBufferBitmapSize
Definition: AppImplMswRendererGdi.h:57
Definition: Area.h:37
::HDC mPaintDc
Definition: AppImplMswRendererGdi.h:51
::HBITMAP mDoubleBufferBitmap
Definition: AppImplMswRendererGdi.h:56
virtual void kill()
Definition: AppImplMswRendererGdi.h:42
::HDC mDoubleBufferDc
Definition: AppImplMswRendererGdi.h:55
virtual bool initialize(HWND wnd, HDC dc, RendererRef sharedRenderer)
Definition: AppImplMswRendererGdi.cpp:81
Definition: AppImplMswRendererGdi.h:37
AppImplMswRendererGdi(App *aApp, bool doubleBuffer)
Definition: AppImplMswRendererGdi.cpp:32
Surface8u copyWindowContents(const Area &area)
Definition: AppImplMswRendererGdi.cpp:87
virtual void swapBuffers() const
Definition: AppImplMswRendererGdi.cpp:40
bool mDoubleBuffer
Definition: AppImplMswRendererGdi.h:54
Definition: App.h:127
::PAINTSTRUCT mPaintStruct
Definition: AppImplMswRendererGdi.h:52
virtual void defaultResize() const
Definition: AppImplMswRendererGdi.cpp:37
std::shared_ptr< class Renderer > RendererRef
Definition: Renderer.h:85
::HBITMAP mDoubleBufferOldBitmap
Definition: AppImplMswRendererGdi.h:56
virtual HDC getDc() const
Definition: AppImplMswRendererGdi.h:47