赞 | 3 |
VIP | 1 |
好人卡 | 0 |
积分 | 16 |
经验 | 1887 |
最后登录 | 2024-3-14 |
在线时间 | 277 小时 |
Lv3.寻梦者
- 梦石
- 1
- 星屑
- 644
- 在线时间
- 277 小时
- 注册时间
- 2008-3-30
- 帖子
- 77
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
我想在游戏里require一个so库(opengl),可是总是出问题:- #
- # Copyright (C) 2006 Peter McLain <[email protected]>
- # Copyright (C) 2007 Jan Dvorak <[email protected]>
- #
- # This program is distributed under the terms of the MIT license.
- # See the included MIT-LICENSE file for the terms of this license.
- #
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- #
- # This module provides access to the GL,GLU and GLUT methods and constants
- # in the way that they were available in previous versions of ruby-opengl.
- #
- # Thanks to Ilmari Heikkinen for a previous "reversed" version of this code,
- # and to Bill Kelly for a version before that one.
- temp = Dir.getwd
- $:.push(temp)
- require 'gl.so'
- require 'glu.so'
- require 'glut.so'
- include Gl,Glu,Glut
- # (Gl.)glVertex -> GL.Vertex
- # (Gl::)GL_TRUE -> GL::TRUE
- module GL
- extend self
- include Gl
-
- Gl.constants.each do |cn|
- n = cn.to_s.sub(/^GL_/,'')
- # due to ruby naming scheme, we can't export constants with leading decimal,
- # e.g. (Gl::)GL_2D would under old syntax become (GL::)2D which is illegal
- next if n =~ /^[0-9]/
- const_set( n, Gl.const_get( cn ) )
- end
-
- Gl.methods( false ).each do |mn|
- n = mn.to_s.sub(/^gl/,'')
- alias_method( n, mn )
- public( n )
- end
- end
- # (Glu.)gluSphere -> GLU.Sphere
- # (Glu::)GLU_INSIDE -> GLU::INSIDE
- module GLU
- extend self
- include Glu
-
- Glu.constants.each do |cn|
- n = cn.to_s.sub(/^GLU_/,'')
- const_set( n, Glu.const_get( cn ) )
- end
-
- Glu.methods( false ).each do |mn|
- n = mn.to_s.sub(/^glu/,'')
- alias_method( n, mn )
- public( n )
- end
- end
- # (Glut.)glutInit -> GLUT.Init
- # (Glut::)GLUT_RGBA -> GLUT::RGBA
- module GLUT
- extend self
- include Glut
-
- Glut.constants.each do |cn|
- n = cn.to_s.sub(/^GLUT_/,'')
- const_set( n, Glut.const_get( cn ) )
- end
-
- Glut.methods( false ).each do |mn|
- n = mn.to_s.sub(/^glut/,'')
- alias_method( n, mn )
- public( n )
- end
- end
复制代码 提示runtime error(C++ Library)
然后我换成load- temp = Dir.getwd
- $:.push(temp)
- load 'gl.so'
- load 'glu.so'
- load 'glut.so'
- include Gl,Glu,Glut
- # (Gl.)glVertex -> GL.Vertex
- # (Gl::)GL_TRUE -> GL::TRUE
复制代码 提示game.exe遇到问题需要关闭
这怎么办? |
|