From 9fabc0f6dae2472af9c4b71589b9bedeae84b8d2 Mon Sep 17 00:00:00 2001 From: Alexander von Gluck IV Date: Sun, 29 Jan 2012 09:59:39 -0600 Subject: [PATCH] opengl add-ons: Style cleanup --- .../opengl/nvidia/NVidiaHardwareRenderer.cpp | 27 ++++++++++-------- .../opengl/radeon/RadeonHardwareRenderer.cpp | 28 ++++++++++--------- 2 files changed, 30 insertions(+), 25 deletions(-) diff --git a/src/add-ons/opengl/nvidia/NVidiaHardwareRenderer.cpp b/src/add-ons/opengl/nvidia/NVidiaHardwareRenderer.cpp index dea5a13b2b..da2d5de751 100644 --- a/src/add-ons/opengl/nvidia/NVidiaHardwareRenderer.cpp +++ b/src/add-ons/opengl/nvidia/NVidiaHardwareRenderer.cpp @@ -1,15 +1,17 @@ /* - * Copyright 2006, Haiku. All rights reserved. + * Copyright 2006-2012 Haiku, Inc. All rights reserved. * Distributed under the terms of the MIT License. */ + #include #include #include -extern "C" _EXPORT BGLRenderer * -instanciate_gl_renderer(BGLView *view, ulong options, BGLDispatcher *dispatcher) + +extern "C" _EXPORT BGLRenderer* +instanciate_gl_renderer(BGLView* view, ulong options, BGLDispatcher* dispatcher) { if (!view) return NULL; @@ -17,27 +19,28 @@ instanciate_gl_renderer(BGLView *view, ulong options, BGLDispatcher *dispatcher) BWindow *window = view->Window(); if (!window) return NULL; - + BScreen screen(window); if (!screen.IsValid()) return NULL; - + accelerant_device_info adi; if (screen.GetDeviceInfo(&adi) !=B_OK) return NULL; - + fprintf(stderr, "Accelerant device info:\n" - " version: %ud\n" - " name: %s\n" - " chipset: %s\n" - " serial#: %s\n", (unsigned int) adi.version, adi.name, adi.chipset, adi.serial_no); + " version: %ud\n" + " name: %s\n" + " chipset: %s\n" + " serial#: %s\n", + (unsigned int) adi.version, adi.name, adi.chipset, adi.serial_no); flush(stderr); - + // Check the view is attached to a screen driven by a NVidia chip: if (strncmp(adi.name, "Nvidia", 6) == 0) { // return new NVidiaHardwareRenderer(view, options, dispatcher); return NULL; } - + return NULL; } diff --git a/src/add-ons/opengl/radeon/RadeonHardwareRenderer.cpp b/src/add-ons/opengl/radeon/RadeonHardwareRenderer.cpp index 01b925af3a..12ef0f8490 100644 --- a/src/add-ons/opengl/radeon/RadeonHardwareRenderer.cpp +++ b/src/add-ons/opengl/radeon/RadeonHardwareRenderer.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2006, Haiku. All rights reserved. + * Copyright 2006-2012 Haiku, Inc. All rights reserved. * Distributed under the terms of the MIT License. */ @@ -9,45 +9,47 @@ #include #include -extern "C" _EXPORT BGLRenderer * -instanciate_gl_renderer(BGLView *view, ulong options, BGLDispatcher *dispatcher) + +extern "C" _EXPORT BGLRenderer* +instanciate_gl_renderer(BGLView* view, ulong options, BGLDispatcher* dispatcher) { if (!view) { printf("view = NULL!\n"); return NULL; } - BWindow *window = view->Window(); + BWindow* window = view->Window(); if (!window) { printf("view's window = NULL!\n"); return NULL; } - + BScreen screen(window); if (!screen.IsValid()) { printf("Failed to get window's screen!\n"); return NULL; } - + accelerant_device_info adi; if (screen.GetDeviceInfo(&adi) != B_OK) { printf("screen.GetDeviceInfo() failed!\n"); return NULL; } - + printf("Accelerant device info:\n" - " version: %ud\n" - " name: %s\n" - " chipset: %s\n" - " serial#: %s\n", (unsigned int) adi.version, adi.name, adi.chipset, adi.serial_no); - + " version: %ud\n" + " name: %s\n" + " chipset: %s\n" + " serial#: %s\n", + (unsigned int) adi.version, adi.name, adi.chipset, adi.serial_no); + // Check the view is attached to a screen driven by a Radeon chip: if (strcasecmp(adi.chipset, "radeon") == 0 || strcasecmp(adi.chipset, "radeon") == 0) { // return new RadeonHardwareRenderer(view, options, dispatcher); return NULL; } - + // We can't be a renderer for this view, sorry. return NULL; }