VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlayCommon.h@ 33540

Last change on this file since 33540 was 33540, checked in by vboxsync, 14 years ago

*: spelling fixes, thanks Timeless!

  • Property svn:eol-style set to native
File size: 2.9 KB
Line 
1/** @file
2 *
3 * VBox frontends: Qt GUI ("VirtualBox"):
4 * VBoxFrameBuffer Overly classes declarations
5 */
6
7/*
8 * Copyright (C) 2009 Oracle Corporation
9 *
10 * This file is part of VirtualBox Open Source Edition (OSE), as
11 * available from http://www.virtualbox.org. This file is free software;
12 * you can redistribute it and/or modify it under the terms of the GNU
13 * General Public License (GPL) as published by the Free Software
14 * Foundation, in version 2 as it comes in the "COPYING" file of the
15 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
16 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
17 */
18#ifndef __VBoxFBOverlayCommon_h__
19#define __VBoxFBOverlayCommon_h__
20
21#if defined(DEBUG_misha)
22# include "iprt/stream.h"
23# define VBOXQGLLOG(_m) RTPrintf _m
24# define VBOXQGLLOGREL(_m) do { RTPrintf _m ; LogRel( _m ); } while(0)
25#else
26# define VBOXQGLLOG(_m) do {}while(0)
27# define VBOXQGLLOGREL(_m) LogRel( _m )
28#endif
29#define VBOXQGLLOG_ENTER(_m) do {}while(0)
30//do{VBOXQGLLOG(("==>[%s]:", __FUNCTION__)); VBOXQGLLOG(_m);}while(0)
31#define VBOXQGLLOG_EXIT(_m) do {}while(0)
32//do{VBOXQGLLOG(("<==[%s]:", __FUNCTION__)); VBOXQGLLOG(_m);}while(0)
33#ifdef DEBUG
34 #define VBOXQGL_ASSERTNOERR() \
35 do { GLenum err = glGetError(); \
36 if(err != GL_NO_ERROR) VBOXQGLLOG(("gl error occurred (0x%x)\n", err)); \
37 Assert(err == GL_NO_ERROR); \
38 }while(0)
39
40 #define VBOXQGL_CHECKERR(_op) \
41 do { \
42 glGetError(); \
43 _op \
44 VBOXQGL_ASSERTNOERR(); \
45 }while(0)
46#else
47 #define VBOXQGL_ASSERTNOERR() \
48 do {}while(0)
49
50 #define VBOXQGL_CHECKERR(_op) \
51 do { \
52 _op \
53 }while(0)
54#endif
55
56#ifdef DEBUG
57#include <iprt/time.h>
58
59#define VBOXGETTIME() RTTimeNanoTS()
60
61#define VBOXPRINTDIF(_nano, _m) do{\
62 uint64_t cur = VBOXGETTIME(); NOREF(cur); \
63 VBOXQGLLOG(_m); \
64 VBOXQGLLOG(("(%Lu)\n", cur - (_nano))); \
65 }while(0)
66
67class VBoxVHWADbgTimeCounter
68{
69public:
70 VBoxVHWADbgTimeCounter(const char* msg) {mTime = VBOXGETTIME(); mMsg=msg;}
71 ~VBoxVHWADbgTimeCounter() {VBOXPRINTDIF(mTime, (mMsg));}
72private:
73 uint64_t mTime;
74 const char* mMsg;
75};
76
77#define VBOXQGLLOG_METHODTIME(_m) VBoxVHWADbgTimeCounter _dbgTimeCounter(_m)
78
79#define VBOXQG_CHECKCONTEXT() \
80 { \
81 const GLubyte * str; \
82 VBOXQGL_CHECKERR( \
83 str = glGetString(GL_VERSION); \
84 ); \
85 Assert(str); \
86 if(str) \
87 { \
88 Assert(str[0]); \
89 } \
90 }
91#else
92#define VBOXQGLLOG_METHODTIME(_m)
93#define VBOXQG_CHECKCONTEXT() do{}while(0)
94#endif
95
96#define VBOXQGLLOG_QRECT(_p, _pr, _s) do{\
97 VBOXQGLLOG((_p " x(%d), y(%d), w(%d), h(%d)" _s, (_pr)->x(), (_pr)->y(), (_pr)->width(), (_pr)->height()));\
98 }while(0)
99
100#define VBOXQGLLOG_CKEY(_p, _pck, _s) do{\
101 VBOXQGLLOG((_p " l(0x%x), u(0x%x)" _s, (_pck)->lower(), (_pck)->upper()));\
102 }while(0)
103
104#endif /* #ifndef __VBoxFBOverlayCommon_h__ */
105
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use