RioEngine
0.1
My first attempt to create a 3D WYSIWYG Game Engine
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
main.cpp
Go to the documentation of this file.
1
//--------------------------------------------------------------- @License begins
2
// RioEngine: The late night Coke -without whores- debugging sessions
3
// 2012-2015 Leopoldo Lomas Flores. Torreon, Coahuila. MEXICO
4
// leopoldolomas [at] gmail
5
// www.rioengine.com
6
// www.leopoldolomas.info
7
// "You have a problem, you face it like a man."
8
//
9
// This is free and unencumbered software released into the public domain.
10
//
11
// Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
12
// software, either in source code form or as a compiled binary, for any purpose,
13
// commercial or non-commercial, and by any means.
14
//
15
// In jurisdictions that recognize copyright laws, the author or authors of this
16
// software dedicate any and all copyright interest in the software to the public
17
// domain. We make this dedication for the benefit of the public at large and to
18
// the detriment of our heirs and successors. We intend this dedication to be
19
// an overt act of relinquishment in perpetuity of all present and future
20
// rights to this software under copyright law.
21
//
22
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS
24
// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE
25
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
26
// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
27
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28
//--------------------------------------------------------------- @License ends
29
30
#include <windows.h>
31
#include <tchar.h>
32
#include <QApplication>
33
#include <QtMessageHandler>
34
#include "
macro.h
"
35
#include "
editor/editorwindow.h
"
36
#include "
editor/logwindow/logwindow.h
"
37
38
#if VLD_ENABLED
39
#include <
vld.h
>
40
#endif
41
42
LogWindow
*
logWindow
= NULL;
43
QtMessageHandler
logWindowMessageHandler
;
44
QtMessageHandler
mainMessageHandler
;
45
46
void
myMessageOutput
(QtMsgType type,
const
QMessageLogContext &context,
const
QString &msg) {
47
(
mainMessageHandler
)(type, context, msg);
// redirect the message to the console
48
49
if
(logWindow) {
50
logWindow->
log
(msg);
51
}
52
}
53
54
int
main
(
int
argc,
char
*argv[])
55
{
56
#if VLD_ENABLED
57
std::string str =
"MemoryLeaksReport.txt"
;
58
std::wstring widestr = std::wstring(str.begin(), str.end());
59
VLDSetReportOptions
(
VLD_OPT_REPORT_TO_FILE
, widestr.c_str());
60
#endif
61
62
QApplication a(argc, argv);
63
a.setStyle(
"Fusion"
);
64
65
logWindow =
new
LogWindow
();
66
logWindow->show();
67
68
logWindowMessageHandler
= QtMessageHandler(
myMessageOutput
);
69
mainMessageHandler
= qInstallMessageHandler(
logWindowMessageHandler
);
70
71
EditorWindow
w =
EditorWindow
();
72
w.show();
73
74
int
result = a.exec();
75
76
#if VLD_ENABLED
77
VLDReportLeaks
();
78
#endif
79
80
SAFE_RELEASE
(logWindow);
81
82
return
result;
83
}
vld.h
logWindow
LogWindow * logWindow
Definition:
main.cpp:42
LogWindow::log
void log(QString message)
Definition:
logwindow.cpp:44
VLD_OPT_REPORT_TO_FILE
#define VLD_OPT_REPORT_TO_FILE
Definition:
vld_def.h:29
editorwindow.h
VLDSetReportOptions
#define VLDSetReportOptions(a, b)
Definition:
vld.h:305
logWindowMessageHandler
QtMessageHandler logWindowMessageHandler
Definition:
main.cpp:43
VLDReportLeaks
#define VLDReportLeaks()
Definition:
vld.h:293
LogWindow
Definition:
logwindow.h:42
myMessageOutput
void myMessageOutput(QtMsgType type, const QMessageLogContext &context, const QString &msg)
Definition:
main.cpp:46
SAFE_RELEASE
#define SAFE_RELEASE(x)
Definition:
cobject.h:36
mainMessageHandler
QtMessageHandler mainMessageHandler
Definition:
main.cpp:44
macro.h
logwindow.h
EditorWindow
Definition:
editorwindow.h:59
main
int main(int argc, char *argv[])
Definition:
main.cpp:54
rioengine
main.cpp
Generated on Mon Jan 12 2015 22:24:00 for RioEngine by
1.8.9.1