VirtualBox

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

Last change on this file since 74942 was 71027, checked in by vboxsync, 6 years ago

FE/Qt: big svn props cleanup

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

© 2023 Oracle
ContactPrivacy policyTerms of Use