From 9802b1a34c98266e7c7f861a05186bf01a08fd6f Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Tue, 15 Mar 2011 07:46:15 +0000 Subject: [PATCH] Remove rendermode and selection support due to lack of decent hardware support --- source/rendermode.cpp | 28 ---------------- source/rendermode.h | 28 ---------------- source/select.cpp | 78 ------------------------------------------- source/select.h | 36 -------------------- 4 files changed, 170 deletions(-) delete mode 100644 source/rendermode.cpp delete mode 100644 source/rendermode.h delete mode 100644 source/select.cpp delete mode 100644 source/select.h diff --git a/source/rendermode.cpp b/source/rendermode.cpp deleted file mode 100644 index 0c8cb0c4..00000000 --- a/source/rendermode.cpp +++ /dev/null @@ -1,28 +0,0 @@ -/* $Id$ - -This file is part of libmspgl -Copyright © 2007 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - -#include "rendermode.h" -#include "select.h" - -namespace Msp { -namespace GL { - -int render_mode(RenderMode rm) -{ - int old_rm; - glGetIntegerv(GL_RENDER_MODE, &old_rm); - - int result = glRenderMode(rm); - - if(old_rm==SELECT) - _parse_internal_select_records(result); - - return result; -} - -} // namespace GL -} // namespace Msp diff --git a/source/rendermode.h b/source/rendermode.h deleted file mode 100644 index 235dde5e..00000000 --- a/source/rendermode.h +++ /dev/null @@ -1,28 +0,0 @@ -/* $Id$ - -This file is part of libmspgl -Copyright © 2007 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - -#ifndef MSP_GL_RENDERMODE_H_ -#define MSP_GL_RENDERMODE_H_ - -#include "gl.h" - -namespace Msp { -namespace GL { - -enum RenderMode -{ - RENDER = GL_RENDER, - SELECT = GL_SELECT, - FEEDBACK = GL_FEEDBACK -}; - -int render_mode(RenderMode); - -} // namespace GL -} // namespace Msp - -#endif diff --git a/source/select.cpp b/source/select.cpp deleted file mode 100644 index 65ce6ce6..00000000 --- a/source/select.cpp +++ /dev/null @@ -1,78 +0,0 @@ -/* $Id$ - -This file is part of libmspgl -Copyright © 2007 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - -#include "except.h" -#include "gl.h" -#include "select.h" - -using namespace std; - -namespace { - -vector *select_buf = 0; -vector select_buf_int; - -} - -namespace Msp { -namespace GL { - -void select_buffer(vector &buf) -{ - select_buf_int.resize(1024); - glSelectBuffer(select_buf_int.size(), &select_buf_int[0]); - select_buf = &buf; -} - -void init_names() -{ - glInitNames(); -} - -void push_name(unsigned n) -{ - glPushName(n); -} - -void pop_name() -{ - glPopName(); -} - -void load_name(unsigned n) -{ - glLoadName(n); -} - -void parse_select_records(const unsigned *buf, unsigned count, vector &tbuf) -{ - unsigned i = 0; - while(count--) - { - SelectRecord record; - - unsigned n_names = buf[i++]; - record.min_depth = buf[i++]; - record.max_depth = buf[i++]; - - record.names.reserve(n_names); - while(n_names--) - record.names.push_back(buf[i++]); - - tbuf.push_back(record); - } -} - -void _parse_internal_select_records(unsigned count) -{ - if(!select_buf) - throw InvalidState("No select buffer specified"); - parse_select_records(&select_buf_int[0], count, *select_buf); -} - -} // namespace GL -} // namespace Msp diff --git a/source/select.h b/source/select.h deleted file mode 100644 index 16d0e47a..00000000 --- a/source/select.h +++ /dev/null @@ -1,36 +0,0 @@ -/* $Id$ - -This file is part of libmspgl -Copyright © 2007 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - -#ifndef MSP_GL_SELECT_H_ -#define MSP_GL_SELECT_H_ - -#include - -namespace Msp { -namespace GL { - -struct SelectRecord -{ - unsigned min_depth; - unsigned max_depth; - std::vector names; -}; - -void select_buffer(std::vector &); -void init_names(); -void push_name(unsigned); -void pop_name(); -void load_name(unsigned); - -void parse_select_records(const unsigned *buf, unsigned, std::vector &); - -void _parse_internal_select_records(unsigned); - -} // namespace GL -} // namespace Msp - -#endif -- 2.43.0