Code Search for Developers
 
 
  

myqlibrary.h from Boson at Krugle


Show myqlibrary.h syntax highlighted

/*
    This file is part of the Boson game
    Copyright (C) 2006 Andreas Beckermann <b_mann@gmx.de>

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#ifndef MYQLIBRARY_H
#define MYQLIBRARY_H

#include "qstring.h"

/**
 * @internal
 *
 * This class exists because @ref QLibrary insists on calling dlopen with
 * RTLD_LAZY, but we need RTLD_GLOBAL - quoting
 * http://dri.sourceforge.net/doc/DRIuserguide.html:
 * <pre>
 * Specify the RTLD_GLOBAL flag to dlopen(). If you don't do this then you'll likely see a runtime error message complaining that _glapi_Context is undefined when libGL.so tries to open a hardware-specific driver. Without this flag, nested opening of dynamic libraries does not work.
 * </pre>
 *
 * This class is meant to be very simple. We don't even try to reproduce all of
 * QLibrary's features.
 *
 * @author Andreas Beckermann <b_mann@gmx.de>
 **/
class MyQLibrary
{
public:
	MyQLibrary(const QString& file);
	~MyQLibrary();

	bool load();
	bool isLoaded() const;
	QString library() const;
	void* resolve(const char* symbol);

private:
	QString mFile;
	void* mHandle;
};

#endif





See more files for this project here

Boson

Boson is an OpenGL real-time strategy game. It is designed to run on Unix (Linux) computers, and is built on top of the KDE, Qt and kdegames libraries.

Project homepage: http://sourceforge.net/projects/boson
Programming language(s): C,C++
License: other

  gl/
    extensions/
      arb_multitexture_decl_p.h
      arb_shader_objects_decl_p.h
      arb_vertex_buffer_object_decl_p.h
      ext_blend_color_decl_p.h
      ext_framebuffer_object_decl_p.h
      ext_polygon_offset_decl_p.h
      ext_texture3d_decl_p.h
    README
    bogl_1_1_decl_p.h
    bogl_1_2_1_decl_p.h
    bogl_1_2_decl_p.h
    bogl_1_3_decl_p.h
    bogl_1_4_decl_p.h
    bogl_1_5_decl_p.h
    bogl_2_0_decl_p.h
    boglu_decl_p.h
  CMakeLists.txt
  bogl.cpp
  bogl.h
  bogl_decl_p.h
  bogl_do_dlopen.h
  bogl_private.h
  bogl_resolve.cpp
  bogl_resolve_symbols.cpp
  boglx.h
  boglx_decl_p.h
  myqlibrary.cpp
  myqlibrary.h