~ubuntu-branches/ubuntu/feisty/gtkglext/feisty

« back to all changes in this revision

Viewing changes to gdk/win32/gdkglwindow-win32.h

  • Committer: Bazaar Package Importer
  • Author(s): Marcelo E. Magallon
  • Date: 2004-04-03 17:43:17 UTC
  • Revision ID: james.westby@ubuntu.com-20040403174317-d5gb2d2gftaligp8
Tags: upstream-1.0.6
ImportĀ upstreamĀ versionĀ 1.0.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* GdkGLExt - OpenGL Extension to GDK
 
2
 * Copyright (C) 2002-2004  Naofumi Yasufuku
 
3
 *
 
4
 * This library is free software; you can redistribute it and/or
 
5
 * modify it under the terms of the GNU Lesser General Public
 
6
 * License as published by the Free Software Foundation; either
 
7
 * version 2.1 of the License, or (at your option) any later version.
 
8
 *
 
9
 * This library is distributed in the hope that it will be useful,
 
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
12
 * Lesser General Public License for more details.
 
13
 *
 
14
 * You should have received a copy of the GNU Lesser General Public
 
15
 * License along with this library; if not, write to the Free Software
 
16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA.
 
17
 */
 
18
 
 
19
#ifndef __GDK_GL_WINDOW_WIN32_H__
 
20
#define __GDK_GL_WINDOW_WIN32_H__
 
21
 
 
22
#include <gdk/gdkglwindow.h>
 
23
#include <gdk/win32/gdkglwin32.h>
 
24
 
 
25
G_BEGIN_DECLS
 
26
 
 
27
typedef struct _GdkGLWindowImplWin32      GdkGLWindowImplWin32;
 
28
typedef struct _GdkGLWindowImplWin32Class GdkGLWindowImplWin32Class;
 
29
 
 
30
#define GDK_TYPE_GL_WINDOW_IMPL_WIN32              (gdk_gl_window_impl_win32_get_type ())
 
31
#define GDK_GL_WINDOW_IMPL_WIN32(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_GL_WINDOW_IMPL_WIN32, GdkGLWindowImplWin32))
 
32
#define GDK_GL_WINDOW_IMPL_WIN32_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_GL_WINDOW_IMPL_WIN32, GdkGLWindowImplWin32Class))
 
33
#define GDK_IS_GL_WINDOW_IMPL_WIN32(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_GL_WINDOW_IMPL_WIN32))
 
34
#define GDK_IS_GL_WINDOW_IMPL_WIN32_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_GL_WINDOW_IMPL_WIN32))
 
35
#define GDK_GL_WINDOW_IMPL_WIN32_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_GL_WINDOW_IMPL_WIN32, GdkGLWindowImplWin32Class))
 
36
 
 
37
struct _GdkGLWindowImplWin32
 
38
{
 
39
  GdkGLWindow parent_instance;
 
40
 
 
41
  HWND hwnd;
 
42
 
 
43
  PIXELFORMATDESCRIPTOR pfd;
 
44
  int pixel_format;
 
45
 
 
46
  GdkGLConfig *glconfig;
 
47
 
 
48
  /*< private >*/
 
49
  HDC hdc;
 
50
 
 
51
  guint is_destroyed    : 1;
 
52
  guint need_release_dc : 1;
 
53
};
 
54
 
 
55
struct _GdkGLWindowImplWin32Class
 
56
{
 
57
  GdkGLWindowClass parent_class;
 
58
};
 
59
 
 
60
GType gdk_gl_window_impl_win32_get_type (void);
 
61
 
 
62
#define GDK_GL_WINDOW_IMPL_WIN32_HDC_GET(impl) \
 
63
  ( ((impl)->hdc != NULL) ? (impl)->hdc : ((impl)->hdc = GetDC ((impl)->hwnd)) )
 
64
 
 
65
#define GDK_GL_WINDOW_IMPL_WIN32_HDC_RELEASE(impl)                      \
 
66
  G_STMT_START {                                                        \
 
67
    if ((impl)->need_release_dc && (impl)->hdc != NULL)                 \
 
68
      { ReleaseDC ((impl)->hwnd, (impl)->hdc); (impl)->hdc = NULL; };   \
 
69
  } G_STMT_END
 
70
 
 
71
G_END_DECLS
 
72
 
 
73
#endif /* __GDK_GL_WINDOW_WIN32_H__ */