2 Copyright (C) 1999-2006 Id Software, Inc. and contributors.
3 For a list of contributors, see the accompanying CONTRIBUTORS file.
5 This file is part of GtkRadiant.
7 GtkRadiant is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 GtkRadiant is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GtkRadiant; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 #include "pluginapi.h"
24 #include "modulesystem.h"
25 #include "qerplugin.h"
27 #include "generic/callback.h"
28 #include "math/vector.h"
32 #include "camwindow.h"
34 #include "mainframe.h"
38 void QERApp_GetCamera( Vector3& origin, Vector3& angles ){
39 CamWnd& camwnd = *g_pParentWnd->GetCamWnd();
40 origin = Camera_getOrigin( camwnd );
41 angles = Camera_getAngles( camwnd );
44 void QERApp_SetCamera( const Vector3& origin, const Vector3& angles ){
45 CamWnd& camwnd = *g_pParentWnd->GetCamWnd();
46 Camera_setOrigin( camwnd, origin );
47 Camera_setAngles( camwnd, angles );
50 void QERApp_GetCamWindowExtents( int *x, int *y, int *width, int *height ){
52 CamWnd* camwnd = g_pParentWnd->GetCamWnd();
54 gtk_window_get_position( camwnd->m_window, x, y );
56 *width = camwnd->Camera()->width;
57 *height = camwnd->Camera()->height;
65 _QERCameraTable m_camera;
67 typedef _QERCameraTable Type;
68 STRING_CONSTANT( Name, "*" );
71 m_camera.m_pfnGetCamera = &QERApp_GetCamera;
72 m_camera.m_pfnSetCamera = &QERApp_SetCamera;
73 m_camera.m_pfnGetCamWindowExtents = &QERApp_GetCamWindowExtents;
75 _QERCameraTable* getTable(){
80 #include "modulesystem/singletonmodule.h"
81 #include "modulesystem/moduleregistry.h"
83 typedef SingletonModule<CameraAPI> CameraModule;
84 typedef Static<CameraModule> StaticCameraModule;
85 StaticRegisterModule staticRegisterCamera( StaticCameraModule::instance() );