File: setupdisplay_mac.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 (41 lines) | stat: -rw-r--r-- 892 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
#include "display_target.h"
#include "API/Core/System/error.h"
#include "API/display.h"
#include "Display/System/Generic/setupdisplay_generic.h"
#include "Display/Display/Quartz/target_quartz.h"
#include "Display/Display/Quartz/display_quartz.h"
#include <Hermes/Hermes.h>

static int display_ref_count = 0;
static CL_Target_Quartz *target;
static CL_DisplayCard_Quartz *display_card;

void CL_SetupDisplay::init(bool register_resources_only)
{
	display_ref_count++;
	if (display_ref_count > 1) return;

	CL_SetupDisplay_Generic::init();

	if (register_resources_only) return;

	Hermes_Init();

	target = new CL_Target_Quartz;
	
	display_card = new CL_DisplayCard_Quartz;	
}

void CL_SetupDisplay::deinit()
{
	display_ref_count--;
	if(display_ref_count > 0) return;

	Hermes_Done();

	if (display_card) delete display_card;

	if (target) delete target;

	CL_SetupDisplay_Generic::deinit();
}