1/* 2 * Copyright 2006-2012 Haiku, Inc. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 6 7#include <stdio.h> 8 9#include <Screen.h> 10#include <GLRenderer.h> 11 12 13extern "C" _EXPORT BGLRenderer* 14instanciate_gl_renderer(BGLView* view, ulong options, BGLDispatcher* dispatcher) 15{ 16 if (!view) 17 return NULL; 18 19 BWindow *window = view->Window(); 20 if (!window) 21 return NULL; 22 23 BScreen screen(window); 24 if (!screen.IsValid()) 25 return NULL; 26 27 accelerant_device_info adi; 28 if (screen.GetDeviceInfo(&adi) !=B_OK) 29 return NULL; 30 31 fprintf(stderr, "Accelerant device info:\n" 32 " version: %ud\n" 33 " name: %s\n" 34 " chipset: %s\n" 35 " serial#: %s\n", 36 (unsigned int) adi.version, adi.name, adi.chipset, adi.serial_no); 37 flush(stderr); 38 39 // Check the view is attached to a screen driven by a NVidia chip: 40 if (strncmp(adi.name, "Nvidia", 6) == 0) { 41 // return new NVidiaHardwareRenderer(view, options, dispatcher); 42 return NULL; 43 } 44 45 return NULL; 46} 47