2
* $Id: KXH_MSWindows_services.cpp 28254 2010-04-18 10:28:37Z campbellbarton $
4
* ***** BEGIN GPL LICENSE BLOCK *****
6
* This program is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU General Public License
8
* as published by the Free Software Foundation; either version 2
9
* of the License, or (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software Foundation,
18
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
21
* All rights reserved.
23
* The Original Code is: all of this file.
25
* Contributor(s): none yet.
27
* ***** END GPL LICENSE BLOCK *****
28
* Implementation of the application hooks between browser and app,
34
#include "SCA_IInputDevice.h"
35
//#include "SCA_ISystem.h"
36
#include "GPC_MouseDevice.h"
37
#include "GPW_KeyboardDevice.h"
38
#include "GPW_System.h"
39
#include "GPW_Canvas.h"
40
#include "GPC_RenderTools.h"
41
#include "GPC_RawImage.h"
42
#include "GPC_RawLoadDotBlendArray.h"
43
#include "GPC_RawLogoArrays.h"
44
#include "SND_DeviceManager.h"
45
#include "RAS_OpenGLRasterizer.h"
46
#include "NG_LoopBackNetworkDeviceInterface.h"
48
//#include "PLG_plugin_handles.h"
49
#include "NZC_application_callback.h"
50
#include "NZC_application_hooks.h"
51
#include "KXH_MSWindows_services.h"
52
#include "PLG_MSWindows_windowing.h"
69
// log_entry("KXH_create_devices");
71
k->logic_system = new GPW_System();
74
k->keyboarddevice = new GPW_KeyboardDevice();
75
k->mousedevice = new GPC_MouseDevice();
76
k->net_dev = new NG_LoopBackNetworkDeviceInterface();
79
SND_DeviceManager::Subscribe();
80
SND_DeviceManager::SetDeviceType(snd_e_dummydevice);
81
k->audiodevice = SND_DeviceManager::Instance();
83
/* Apart from the sizes, we don't need to do anything
84
* here. Proper initialization is not an issue here... without
85
* correct canvas, we'd never have ended up here. Why is this
86
* so much different from the win solution ? Because the win
87
* version swaps buffers etc. in the canvas code. There is
88
* less strict separation of concerns on windows...*/
89
width = PLA_get_display_width(k->plugin);
90
height = PLA_get_display_height(k->plugin);
91
HWND winhandle = PLA_get_HWND(k->plugin);
93
HDC ctxhandle = PLA_get_HDC(k->plugin);
97
GPW_Canvas* temp_canv = new GPW_Canvas(winhandle,
101
// does the actual init
102
// log_entry("KXH_create_devices:: initialize canvas:");
105
k->canvas_device = temp_canv;
107
// create a rasterizer
108
k->rasterizer = new RAS_OpenGLRasterizer(k->canvas_device);
110
// Well, rendertools only wraps a few gl-calls...
111
k->rendertools = new GPC_RenderTools();
117
ketsji_engine_data* k
121
// log_entry("KXH_add_banners");
123
GPW_Canvas* c = (GPW_Canvas*) k->canvas_device;
125
k->blender_logo = new GPC_RawImage();
126
k->blender_url_logo = new GPC_RawImage();
128
if(!k->blender_logo->Load("BlenderLogo",
130
GPC_RawImage::alignTopLeft,
135
c->AddBanner(k->blender_logo->Width(),
136
k->blender_logo->Height(),
137
k->blender_logo->Width(),
138
k->blender_logo->Height(),
139
k->blender_logo->Data(),
140
GPC_Canvas::alignTopLeft);
143
if(!k->blender_url_logo->Load("Blender3DLogo",
145
GPC_RawImage::alignBottomRight,
148
k->blender_url_logo = 0;
150
c->AddBanner(k->blender_url_logo->Width(),
151
k->blender_url_logo->Height(),
152
k->blender_url_logo->Width(),
153
k->blender_url_logo->Height(),
154
k->blender_url_logo->Data(),
155
GPC_Canvas::alignBottomRight);
158
c->SetBannerDisplayEnabled(true);
166
FILE* fp = fopen("/tmp/plugin_log","a");
168
fprintf(fp, "--> KXH_MSWindows_services::(%p) %s\n",
169
PR_GetCurrentThread(),