File: netobjects.cpp

package info (click to toggle)
clanlib 0.5.4-1-6
  • links: PTS
  • area: main
  • in suites: woody
  • size: 10,320 kB
  • ctags: 10,893
  • sloc: cpp: 76,056; xml: 3,281; sh: 2,961; perl: 1,204; asm: 837; makefile: 775
file content (77 lines) | stat: -rw-r--r-- 1,781 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#include <ClanLib/core.h>
#include <ClanLib/network.h>
#include <ClanLib/gl.h>
#include <ClanLib/gui.h>
#include <ClanLib/png.h>
#include <ClanLib/jpeg.h>
#include <ClanLib/display.h>
#include <ClanLib/sound.h>

#include "GUI/stylemanager_opengl.h"
#include "netobjects.h"
#include "mainmenu.h"
#include "intro.h"

Main app; // one and only application instance.

int Main::main(int argc, char **argv)
{
	// Create a console window for text-output if not available
	CL_ConsoleWindow console("NetObjects",80,1000); // 1000 allows a y-scrollbar to be present
	console.redirect_stdio();

	try
	{
		CL_SetupCore::init();
		CL_SetupNetwork::init();
		CL_SetupGL::init();
		CL_SetupGUI::init();
		CL_SetupPNG::init();
		CL_SetupJPEG::init();
//		CL_SetupVorbis::init();
//		CL_SetupTTF::init();
		CL_SetupDisplay::init();
		CL_SetupSound::init();

		// Setup a window for our game:
		CL_Display::set_videomode(640, 480, 32, false);

		CL_OpenGL::begin_2d();

		// Setup resources:
		CL_ResourceManager *resources = new CL_ResourceManager("resources.scr", false);
		resources->load_all();

		// Setup styles for gui:
		CL_StyleManager_OpenGL styles(resources);

//		Intro intro(resources);
//		intro.run();

		// Create main menu and run it modal:
		MainMenu menu(NULL, &styles);
		menu.run();

		CL_OpenGL::end_2d();

		CL_SetupSound::deinit();
		CL_SetupDisplay::deinit();
//		CL_SetupVorbis::deinit();
//		CL_SetupTTF::deinit();
		CL_SetupPNG::deinit();
		CL_SetupJPEG::deinit();
		CL_SetupGUI::deinit();
		CL_SetupGL::deinit();
		CL_SetupNetwork::deinit();
		CL_SetupCore::deinit();
	}
	catch (CL_Error error)
	{
		std::cout << "Error: " << error.message.c_str() << std::endl;

		// Display console close message and wait for a key
		console.display_close_message();
	}

	return 0;
}