/*---------------------------------------------------------------------- | CUPnP::StartRenderer +---------------------------------------------------------------------*/ bool CUPnP::StartRenderer() { if (!m_RendererHolder->m_Device.IsNull()) return false; std::string filename = URIUtils::AddFileToFolder(CProfilesManager::GetInstance().GetUserDataFolder(), "upnpserver.xml"); CUPnPSettings::GetInstance().Load(filename); m_RendererHolder->m_Device = CreateRenderer(CUPnPSettings::GetInstance().GetRendererPort()); NPT_Result res = m_UPnP->AddDevice(m_RendererHolder->m_Device); // failed most likely because port is in use, try again with random port now if (NPT_FAILED(res) && CUPnPSettings::GetInstance().GetRendererPort() != 0) { m_RendererHolder->m_Device = CreateRenderer(0); res = m_UPnP->AddDevice(m_RendererHolder->m_Device); } // save port but don't overwrite saved settings if random if (NPT_SUCCEEDED(res) && CUPnPSettings::GetInstance().GetRendererPort() == 0) { CUPnPSettings::GetInstance().SetRendererPort(m_RendererHolder->m_Device->GetPort()); } // save UUID CUPnPSettings::GetInstance().SetRendererUUID(m_RendererHolder->m_Device->GetUUID().GetChars()); return CUPnPSettings::GetInstance().Save(filename); }
/*---------------------------------------------------------------------- | CUPnP::StartRenderer +---------------------------------------------------------------------*/ void CUPnP::StartRenderer() { if (!m_RendererHolder->m_Device.IsNull()) return; CStdString filename; URIUtils::AddFileToFolder(g_settings.GetUserDataFolder(), "upnpserver.xml", filename); g_settings.LoadUPnPXml(filename); m_RendererHolder->m_Device = CreateRenderer(g_settings.m_UPnPPortRenderer); NPT_Result res = m_UPnP->AddDevice(m_RendererHolder->m_Device); // failed most likely because port is in use, try again with random port now if (NPT_FAILED(res) && g_settings.m_UPnPPortRenderer != 0) { m_RendererHolder->m_Device = CreateRenderer(0); res = m_UPnP->AddDevice(m_RendererHolder->m_Device); } // save port but don't overwrite saved settings if random if (NPT_SUCCEEDED(res) && g_settings.m_UPnPPortRenderer == 0) { g_settings.m_UPnPPortRenderer = m_RendererHolder->m_Device->GetPort(); } // save UUID g_settings.m_UPnPUUIDRenderer = m_RendererHolder->m_Device->GetUUID(); g_settings.SaveUPnPXml(filename); }
void OnPaint(HWND hwnd) { HRESULT hr = S_OK; // Update the current state. UpdateAnimation(hwnd); if (g_renderer == NULL) { hr = CreateRenderer(hwnd); } // Paint the current frame. if (SUCCEEDED(hr)) { PAINTSTRUCT ps; HDC hdc = BeginPaint(hwnd, &ps); SetLayout(ps.hdc, LAYOUT_BITMAPORIENTATIONPRESERVED); hr = g_renderer->Draw(hdc); EndPaint(hwnd, &ps); } if (FAILED(hr)) { PostQuitMessage(hr); return; } // Invalidate if we're animating. if (IsAnimating()) { InvalidateRect(hwnd, NULL, TRUE); } }
void Window::SetUpWindow(unsigned int width, unsigned int height, std::string title, Uint32 flags) { CreateWindow(width, height, title, flags); CreateRenderer(); SDL_SetRenderDrawColor(renderer, 0xFF, 0xFF, 0xFF, 0xFF); windowSurface = SDL_GetWindowSurface(window); }
bool Renderer::Init( const SDL_Rect &rect, bool startFS, bool server ) { #if defined(_WIN32) tileTextures.resize( 4 ); hardTileTextures.resize( 5 ); #endif isFullscreen= startFS; background = rect; scale = ( background.h ) / 1080.0; if ( isFullscreen ) screenFlags = SDL_WINDOW_FULLSCREEN; else screenFlags = SDL_WINDOW_OPENGL; if ( !InitSDLSubSystems()) return false; if ( !CreateWindow( server ) ) return false; if ( !CreateRenderer() ) return false; Setup(); if ( !LoadAssets() ) return false; return true; }
status_t GLRendererRoster::AddPath(const char* path) { BDirectory directory(path); status_t status = directory.InitCheck(); if (status < B_OK) return status; node_ref nodeRef; status = directory.GetNodeRef(&nodeRef); if (status < B_OK) return status; int32 count = 0; int32 files = 0; entry_ref ref; while (directory.GetNextRef(&ref) == B_OK) { if (CreateRenderer(ref) == B_OK) count++; files++; } if (files != 0 && count == 0) return B_BAD_VALUE; return B_OK; }
/** * InitEverything: Initializes the SDL2 library and all graphical components: font, window, renderer * \param width width in px of the window * \param height height in px of the window * \param _img surface to be created with the table background and IST logo * \param _window represents the window of the application * \param _renderer renderer to handle all rendering in a window */ void InitEverything(int width, int height, TTF_Font **_font, SDL_Surface *_img[], SDL_Window** _window, SDL_Renderer** _renderer) { InitSDL(); InitFont(); *_window = CreateWindow(width, height); *_renderer = CreateRenderer(width, height, *_window); // load the table texture _img[0] = IMG_Load("assets//table_texture.png"); if (_img[0] == NULL) { fprintf(stderr, "Unable to load image: %s\n", SDL_GetError()); exit(EXIT_FAILURE); } // load IST logo _img[1] = SDL_LoadBMP("assets//ist_logo.bmp"); if (_img[1] == NULL) { fprintf(stderr, "Unable to load bitmap: %s\n", SDL_GetError()); exit(EXIT_FAILURE); } // this opens (loads) a font file and sets a size *_font = TTF_OpenFont("assets//FreeSerif.ttf", 16); if(*_font == NULL) { fprintf(stderr, "TTF_OpenFont: %s\n", TTF_GetError()); exit(EXIT_FAILURE); } }
/// <summary> /// Create a new renderer based on the options selected on the GUI. /// If a renderer matching the options has already been created, no action is taken. /// </summary> /// <returns>True if a valid renderer is created or if no action is taken, else false.</returns> bool FinalRenderEmberControllerBase::CreateRendererFromGUI() { bool useOpenCL = m_Info.Ok() && m_FinalRenderDialog->OpenCL(); auto v = Devices(m_FinalRenderDialog->Devices()); return CreateRenderer((useOpenCL && !v.empty()) ? OPENCL_RENDERER : CPU_RENDERER, v, false);//Not shared. }
int C3DView::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CView::OnCreate(lpCreateStruct) == -1) return -1; CreateRenderer(); m_OldCursor = GetRenderer()->GetCursor(); return 0; }
DiParticleRenderer* DiEffectManager::CloneRenderer(DiParticleRenderer* renderer) { if (!renderer) { return 0; } DiParticleRenderer* clonedRenderer = CreateRenderer(renderer->GetRendererType()); renderer->CopyTo(clonedRenderer); return clonedRenderer; }
void Controller::LoadContent() { mRenderer = CreateRenderer(); if (!mRenderer->Init(Vec2(1280.f, 720.f))) { Log::Error("Failed to initialize Renderer"); } if (!mScene) { Log::Verbose("Controller has no Scene"); } }
WindowManger::WindowManger::WindowManger(char* title, int posx, int posy, int width, int height) :_window(nullptr), _renderer(nullptr), _fps(60) { _window = SDL_CreateWindow(title, posx, posy, width, height, SDL_WINDOW_SHOWN | SDL_WINDOW_ALLOW_HIGHDPI | SDL_WINDOW_OPENGL); ASSERT(_window); _renderer = CreateRenderer(); ASSERT(_renderer); }
SDLBackend::SDLBackend(SDLBackendSettings const& settings) : camera_({settings.camera_x, settings.camera_y, settings.width, settings.height}) , width_ (settings.width) , height_(settings.height) , world_width_ (settings.world_width) , world_height_(settings.world_height) , title_ (settings.title) { InitSDL(); CreateWindow(); CreateRenderer(); }
bool Application::Initialize(EGraphicsAPI a_GraphicsAPI) { Input::Initialize(); m_Window = new Window(L"DX12 Demo", 640, 480, true, true); if (!CreateRenderer(a_GraphicsAPI)) return false; // NOTE (JDL): This should be done differently. if (!LoadDemoScene()) return false; return true; }
static GameState* CreateNewGameState(char* window_title, int res_x, int res_y) { MemoryArena arena; // NOTE: this is the allocation for the game, store this somewhere if this should be freed manually at some point AllocateMemoryArena(&arena, sizeof(GameState) + GAME_PERMANENT_MEMORY_SIZE + FRAME_TEMPORARY_MEMORY_SIZE); GameState* result = PushStruct(&arena, GameState); result->temporary_memory = CreateSubArena(&arena, FRAME_TEMPORARY_MEMORY_SIZE); result->permanent_memory = CreateSubArena(&arena, GAME_PERMANENT_MEMORY_SIZE); assert(arena.used == arena.size); result->input = PushStruct(&result->permanent_memory, NewInput); result->renderer = CreateRenderer(&result->permanent_memory); InitializeTime(result, MS_PER_FRAME); return result->renderer ? result : nullptr; }
void CGameWindow::OpenWindow() { int iScreenWidth, iScreenHeight; GetScreenSize(iScreenWidth, iScreenHeight); #ifdef _DEBUG BaseClass::OpenWindow(iScreenWidth*2/3, iScreenHeight*2/3, false, false); #else BaseClass::OpenWindow(iScreenWidth*2/3, iScreenHeight*2/3, false, false); #endif RenderLoading(); m_pGameServer = new CGameServer(); m_pRenderer = CreateRenderer(); m_pRenderer->Initialize(); }
status_t GLRendererRoster::AddPath(const char* path) { BDirectory directory(path); status_t status = directory.InitCheck(); if (status < B_OK) return status; // if a subdirectory for our ABI exists, use that instead if (fABISubDirectory != NULL) { BEntry entry(&directory, fABISubDirectory); if (entry.IsDirectory()) { status = directory.SetTo(&entry); if (status != B_OK) return status; } } node_ref nodeRef; status = directory.GetNodeRef(&nodeRef); if (status < B_OK) return status; int32 count = 0; int32 files = 0; entry_ref ref; BEntry entry; while (directory.GetNextRef(&ref) == B_OK) { entry.SetTo(&ref, true); if (entry.InitCheck() == B_OK && !entry.IsFile()) continue; if (CreateRenderer(ref) == B_OK) count++; files++; } if (files != 0 && count == 0) return B_BAD_VALUE; return B_OK; }
/* Function that initializes the renderer, the window and all fonts param: width of the window param: height of the window param: font serif param: font Demonized param: font Queen param: the window for the game param: the renderer to handle all rendering in the window */ void InitEverything(int width, int height, TTF_Font **_font, TTF_Font **_font2, TTF_Font **_font3, TTF_Font **_font4, TTF_Font **_font5, SDL_Window** _window, SDL_Renderer** _renderer) { InitSDL(); InitFont(); *_window = CreateWindow(width, height); *_renderer = CreateRenderer(width, height, *_window); *_font = TTF_OpenFont("FreeSerif.ttf", 16); if(!*_font) { printf("TTF_OpenFont: %s\n", TTF_GetError()); exit(EXIT_FAILURE); } *_font2 = TTF_OpenFont("Demonized.ttf", 15); if(!* _font2) { printf("TTF_OpenFont: %s\n", TTF_GetError()); exit(EXIT_FAILURE); } *_font3 = TTF_OpenFont("Queen.ttf", 18); if(!* _font3) { printf("TTF_OpenFont: %s\n", TTF_GetError()); exit(EXIT_FAILURE); } *_font4 = TTF_OpenFont("Queen.ttf", 40); if(!* _font4) { printf("TTF_OpenFont: %s\n", TTF_GetError()); exit(EXIT_FAILURE); } *_font5 = TTF_OpenFont("Targa.ttf", 18); if(!* _font5) { printf("TTF_OpenFont: %s\n", TTF_GetError()); exit(EXIT_FAILURE); } }
bool RabidEngine::OnInitialize(int argc, char** argv) { LOG_START("rabid_log.html"); g_fileSystem = (IFileSystem*)new FileSystem(); g_fileSystem->AddPath(); g_defMgr = new DefMgr(); g_cvarSystem = new CVarSystem(); g_cvarSystem->Initialize(); CVar::RegisterStaticCVars(); g_console = new Console(); g_console->SetScreenDimensions(GetWidth(), GetHeight()); g_commandSystem = new CommandSystem(); g_commandSystem->Initialize(); g_common = new Common(); g_renderer = CreateRenderer("GL"); g_renderer->SetViewport(0,0, GetWidth(), GetHeight()); g_common->Print("\x009### Rabid Hardware Radiosity Engine"); g_common->Print("\x009### Based on the Catharsis Game Engine"); g_common->Print("\x009### Christopher Olsen"); g_common->Print("\x005### \x007SPACE\x005 distributes light ###"); g_common->Print("\x005### \x007TAB\x005 switches light view modes ###"); g_common->Print("\x005### \x007""B\x005 toggles the brightest surface ###"); LoadMap("test.map"); cl_camrotx.SetFloat(0.0); cl_camroty.SetFloat(0.0); cl_camrotz.SetFloat(0.0); logo = g_materialSystem->GetMaterial("logo"); return true; }
void UWKBrowser::Restart() { if (!nativeTexturePtr_) { UWKError::FatalError("Unable to restart browser without native texture ptr"); return; } DestroyRenderer(); CreateRenderer(flags_); UWKMessage msg; msg.type = UMSG_VIEW_CREATE; msg.browserID = id_; msg.iParams[0] = maxWidth_; msg.iParams[1] = maxHeight_; UWKMessageQueue::SetString(msg, 0, currentURL_.c_str()); UWKMessageQueue::Write(msg); }
bool CApplication::OpenWindow(size_t iWidth, size_t iHeight, bool bFullscreen, bool bResizeable) { #ifdef __APPLE__ // On macOS, glfwInit() can change the current directory. // See http://www.glfw.org/docs/latest/group__init.html char *cwd = getcwd(0, 0); int ret = glfwInit(); chdir(cwd); free(cwd); #else int ret = glfwInit(); #endif if (!ret) { printf("glfwInit failed\n"); exit(1); } m_bFullscreen = bFullscreen; if (HasCommandLineSwitch("--fullscreen")) m_bFullscreen = true; if (HasCommandLineSwitch("--windowed")) m_bFullscreen = false; m_iWindowWidth = iWidth; m_iWindowHeight = iHeight; glfwOpenWindowHint(GLFW_OPENGL_VERSION_MAJOR, 3); glfwOpenWindowHint(GLFW_OPENGL_VERSION_MINOR, 2); glfwOpenWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); if (m_bMultisampling) glfwOpenWindowHint(GLFW_FSAA_SAMPLES, 4); glfwOpenWindowHint(GLFW_DEPTH_BITS, 16); glfwOpenWindowHint(GLFW_RED_BITS, 8); glfwOpenWindowHint(GLFW_GREEN_BITS, 8); glfwOpenWindowHint(GLFW_BLUE_BITS, 8); glfwOpenWindowHint(GLFW_ALPHA_BITS, 8); if (!(m_pWindow = (size_t)glfwOpenWindow(iWidth, iHeight, 8, 8, 8, 8, 16, 0, GLFW_WINDOW))) { glfwTerminate(); return false; } glfwSetWindowTitle((char*)L"Math for Game Developers"); int iScreenWidth; int iScreenHeight; GetScreenSize(iScreenWidth, iScreenHeight); if (!m_bFullscreen) { // The taskbar is at the bottom of the screen. Pretend the screen is smaller so the window doesn't clip down into it. // Also the window's title bar at the top takes up space. iScreenHeight -= 70; int iWindowX = (int)(iScreenWidth/2-m_iWindowWidth/2); int iWindowY = (int)(iScreenHeight/2-m_iWindowHeight/2); iWindowY -= 40; // Move it a tad so that we can see it better in the videos. iWindowX -= 80; glfwSetWindowPos(iWindowX, iWindowY); } glfwSetWindowCloseCallback(&CApplication::WindowCloseCallback); glfwSetWindowSizeCallback(&CApplication::WindowResizeCallback); glfwSetKeyCallback(&CApplication::KeyEventCallback); glfwSetCharCallback(&CApplication::CharEventCallback); glfwSetMousePosCallback(&CApplication::MouseMotionCallback); glfwSetMouseButtonCallback(&CApplication::MouseInputCallback); glfwSwapInterval( 1 ); glfwSetTime( 0.0 ); SetMouseCursorEnabled(true); GLenum err = gl3wInit(); if (0 != err) exit(0); glEnable(GL_CULL_FACE); glEnable(GL_DEPTH_TEST); glLineWidth(1.0); m_bIsOpen = true; m_pRenderer = CreateRenderer(); m_pRenderer->Initialize(); return true; }
void CApplication::OpenWindow(size_t iWidth, size_t iHeight, bool bFullscreen, bool bResizeable) { glfwInit(); m_bFullscreen = bFullscreen; if (HasCommandLineSwitch("--fullscreen")) m_bFullscreen = true; if (HasCommandLineSwitch("--windowed")) m_bFullscreen = false; m_iWindowWidth = iWidth; m_iWindowHeight = iHeight; glfwOpenWindowHint(GLFW_OPENGL_VERSION_MAJOR, 3); glfwOpenWindowHint(GLFW_OPENGL_VERSION_MINOR, 0); glfwOpenWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_FALSE); if (m_bMultisampling) glfwOpenWindowHint(GLFW_FSAA_SAMPLES, 4); glfwOpenWindowHint(GLFW_DEPTH_BITS, 16); glfwOpenWindowHint(GLFW_RED_BITS, 8); glfwOpenWindowHint(GLFW_GREEN_BITS, 8); glfwOpenWindowHint(GLFW_BLUE_BITS, 8); glfwOpenWindowHint(GLFW_ALPHA_BITS, 8); if (!(m_pWindow = (size_t)glfwOpenWindow(iWidth, iHeight, 8, 8, 8, 8, 16, 0, GLFW_WINDOW))) { glfwTerminate(); return; } int iScreenWidth; int iScreenHeight; GetScreenSize(iScreenWidth, iScreenHeight); if (!m_bFullscreen) { // The taskbar is at the bottom of the screen. Pretend the screen is smaller so the window doesn't clip down into it. // Also the window's title bar at the top takes up space. iScreenHeight -= 70; int iWindowX = (int)(iScreenWidth/2-m_iWindowWidth/2); int iWindowY = (int)(iScreenHeight/2-m_iWindowHeight/2); iWindowY -= 80; // Move it up a tad so that we can see it better in the videos. glfwSetWindowPos(iWindowX, iWindowY); } glfwSetWindowCloseCallback(&CApplication::WindowCloseCallback); glfwSetWindowSizeCallback(&CApplication::WindowResizeCallback); glfwSetKeyCallback(&CApplication::KeyEventCallback); glfwSetCharCallback(&CApplication::CharEventCallback); glfwSetMousePosCallback(&CApplication::MouseMotionCallback); glfwSetMouseButtonCallback(&CApplication::MouseInputCallback); glfwSwapInterval( 1 ); glfwSetTime( 0.0 ); SetMouseCursorEnabled(true); GLenum err = gl3wInit(); if (0 != err) exit(0); glEnable(GL_CULL_FACE); glEnable(GL_DEPTH_TEST); glLineWidth(1.0); m_bIsOpen = true; m_pRenderer = CreateRenderer(); m_pRenderer->Initialize(); }
void CApplication::OpenWindow(size_t iWidth, size_t iHeight, bool bFullscreen, bool bResizeable) { glfwInit(); m_bFullscreen = bFullscreen; if (HasCommandLineSwitch("--fullscreen")) m_bFullscreen = true; if (HasCommandLineSwitch("--windowed")) m_bFullscreen = false; m_iWindowWidth = iWidth; m_iWindowHeight = iHeight; glfwOpenWindowHint(GLFW_OPENGL_VERSION_MAJOR, 3); glfwOpenWindowHint(GLFW_OPENGL_VERSION_MINOR, 0); glfwOpenWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_FALSE); glfwOpenWindowHint(GLFW_WINDOW_RESIZABLE, bResizeable?GL_TRUE:GL_FALSE); if (m_bMultisampling) glfwOpenWindowHint(GLFW_FSAA_SAMPLES, 4); if (HasCommandLineSwitch("--debug-gl")) { glfwOpenWindowHint(GLFW_OPENGL_DEBUG_CONTEXT, GL_TRUE); if (!glDebugMessageCallbackARB) TMsg("Your drivers do not support GL_ARB_debug_output, so no GL debug output will be shown.\n"); } glfwOpenWindowHint(GLFW_DEPTH_BITS, 16); glfwOpenWindowHint(GLFW_RED_BITS, 8); glfwOpenWindowHint(GLFW_GREEN_BITS, 8); glfwOpenWindowHint(GLFW_BLUE_BITS, 8); glfwOpenWindowHint(GLFW_ALPHA_BITS, 8); TMsg(sprintf(tstring("Opening %dx%d %s %s window.\n"), iWidth, iHeight, bFullscreen?"fullscreen":"windowed", bResizeable?"resizeable":"fixed-size")); if (!(m_pWindow = (size_t)glfwOpenWindow(iWidth, iHeight, m_bFullscreen?GLFW_FULLSCREEN:GLFW_WINDOWED, WindowTitle().c_str(), NULL))) { glfwTerminate(); return; } int iScreenWidth; int iScreenHeight; GetScreenSize(iScreenWidth, iScreenHeight); if (!m_bFullscreen) { // The taskbar is at the bottom of the screen. Pretend the screen is smaller so the window doesn't clip down into it. // Also the window's title bar at the top takes up space. iScreenHeight -= 70; int iWindowX = (int)(iScreenWidth/2-m_iWindowWidth/2); int iWindowY = (int)(iScreenHeight/2-m_iWindowHeight/2); glfwSetWindowPos((GLFWwindow)m_pWindow, iWindowX, iWindowY); } glfwSetWindowCloseCallback(&CApplication::WindowCloseCallback); glfwSetWindowSizeCallback(&CApplication::WindowResizeCallback); glfwSetKeyCallback(&CApplication::KeyEventCallback); glfwSetCharCallback(&CApplication::CharEventCallback); glfwSetMousePosCallback(&CApplication::MouseMotionCallback); glfwSetMouseButtonCallback(&CApplication::MouseInputCallback); glfwSetScrollCallback(&CApplication::MouseWheelCallback); glfwSwapInterval( 1 ); glfwSetTime( 0.0 ); InitJoystickInput(); SetMouseCursorEnabled(true); GLenum err = gl3wInit(); if (0 != err) exit(0); DumpGLInfo(); if (glDebugMessageCallbackARB) { glDebugMessageCallbackARB(GLDebugCallback, nullptr); tstring sMessage("OpenGL Debug Output Activated"); glDebugMessageInsertARB(GL_DEBUG_SOURCE_APPLICATION_ARB, GL_DEBUG_TYPE_OTHER_ARB, 0, GL_DEBUG_SEVERITY_LOW_ARB, sMessage.length(), sMessage.c_str()); } glEnable(GL_CULL_FACE); glEnable(GL_DEPTH_TEST); glLineWidth(1.0); m_bIsOpen = true; m_pRenderer = CreateRenderer(); m_pRenderer->Initialize(); glgui::RootPanel()->SetSize((float)m_iWindowWidth, (float)m_iWindowHeight); }
DiParticleElement* DiEffectManager::CreateElement(void) { DiParticleElement* technique = DI_NEW DiParticleElement(); technique->SetRenderer(CreateRenderer("Billboard")); return technique; }
value lime_renderer_create (value window) { Renderer* renderer = CreateRenderer ((Window*)(intptr_t)val_float (window)); return alloc_float ((intptr_t)renderer); }
//----------------------------------------------------------------------------- //! //----------------------------------------------------------------------------- tSonar3D::tSonar3D( const boost::shared_ptr<tStructureOverlayLayer>& xSonarImageryLayer, const boost::shared_ptr<tLayer>& xWaypointLayer, const int cameraDepthLevel, QWidget* pParent) : QWidget(pParent) , m_CameraDistanceMin(10.0) , m_CameraDistanceMax(250.0) , m_pSonarDataEngine(0) , m_pNativeWindow(0) , m_CursorEnabled(false) , m_pCameraInteractor(0) , m_TrackBallInteractor() , m_FPSInteractor(&m_SceneSettings.camera) , m_CameraDistanceMeters(cDefaultCameraDistanceMeters) , m_ZoomStepMeters(10) , m_CameraRelativeAngleDegrees(0) , m_CameraDepthLevel(cameraDepthLevel) , m_NewSonarDataAvailable(false) , m_SceneUpdated(false) , m_RenderingInProgress(false) , m_PreviewMode(false) , m_VesselMode(true) , m_FollowVessel(true) , m_NightMode(false) , m_CameraRotating(false) , m_RelativeAzimuth(false) , m_FirstVesselUpdate(true) , m_LastHeading(0) , m_HeadSequence(0) , m_Target(tVector3d::ZERO) { setFocusPolicy(Qt::StrongFocus); m_pNativeWindow = new tNativeWindow(this); QVBoxLayout* pLayout = new QVBoxLayout(this); pLayout->addWidget(m_pNativeWindow); pLayout->setSpacing(0); pLayout->setContentsMargins(0, 0, 0, 0); setLayout(pLayout); m_SceneSettings.exaggeration = 1; m_SceneSettings.wireframe = false; boost::shared_ptr<tSonarPointCloudManager> xManager(new tSonarPointCloudManager(xSonarImageryLayer)); Connect(xManager.get(), SIGNAL(DataUpdated(unsigned int)), this, SLOT(OnUpdatedSonar3DData(unsigned int))); Connect(xManager.get(), SIGNAL(DataAdded(unsigned int)), this, SLOT(OnNewSonar3DData(unsigned int))); Connect(xManager.get(), SIGNAL(DataRemoved(unsigned int)), this, SLOT(OnRemovedSonar3DData(unsigned int))); m_pSonarDataEngine = new tSonar3DDataEngine(xManager); CreateRenderer(xWaypointLayer, xManager); m_MaxNumberOfSonarColumns = xManager->MaxNumberOfSonarColumns(); InitializeCamera(); m_pCameraInteractor = &m_TrackBallInteractor; Connect(m_pSonarDataEngine, SIGNAL(DataSourceChanged(bool)), m_xSonar3DRenderer.get(), SLOT(OnDataSourceChanged(bool)), Qt::QueuedConnection); }
value lime_renderer_create (value window) { Renderer* renderer = CreateRenderer ((Window*)val_data (window)); return CFFIPointer (renderer, gc_renderer); }