]> git.tdb.fi Git - libs/gl.git/blobdiff - source/select.cpp
Add support for detecting extensions
[libs/gl.git] / source / select.cpp
index e989de4e99b59a931fc18cbd750656240acd513c..486ffbeddd2f483cfe4e93a33a0de4fc100533a1 100644 (file)
@@ -1,14 +1,28 @@
+/* $Id$
+
+This file is part of libmspgl
+Copyright © 2007  Mikko Rasa, Mikkosoft Productions
+Distributed under the LGPL
+*/
+
 #include <GL/gl.h>
+#include "except.h"
 #include "select.h"
 
 using namespace std;
 
-namespace Msp {
-namespace GL {
+namespace {
+
+using namespace Msp::GL;
 
 vector<SelectRecord> *select_buf=0;
 vector<uint> select_buf_int;
 
+}
+
+namespace Msp {
+namespace GL {
+
 void select_buffer(vector<SelectRecord> &buf)
 {
        select_buf_int.resize(1024);
@@ -38,8 +52,7 @@ void parse_select_records(const uint *buf, uint count, vector<SelectRecord> &tbu
 void _parse_internal_select_records(uint count)
 {
        if(!select_buf)
-               //XXX throw InvalidOperation();
-               return;
+               throw InvalidOperation("No select buffer specified");
        parse_select_records(&select_buf_int[0], count, *select_buf);
 }