generate texture

T

Tom

I am trying to generate a texture.

When I execute: @texture = glGenTextures(1).first

I get the following error:

[BUG] Bus Error
ruby 1.8.4 (2005-12-24) [i686-darwin8.8.1]

Any help would be great. Thanks.

Tom


Below is a more complete snippet of the code that I am using:

#!/usr/local/bin/ruby

require 'rubygems'
require 'opengl'

include Gl
include Glu
include Glut

class GlutTest

def initialize
puts "=== GlutTest.initialize ==="

@texture = glGenTextures(1).first

# Setup the GLUT display loop callback
@display = lambda do
glClear(Gl::GL_COLOR_BUFFER_BIT | Gl::GL_DEPTH_BUFFER_BIT)

gluOrtho2D(0.0, 128.0, 0.0, 128.0)

glutSwapBuffers
end

....

end
 
T

Tom

I am trying to generate a texture.

When I execute: @texture = glGenTextures(1).first

I get the following error:

[BUG] Bus Error
ruby 1.8.4 (2005-12-24) [i686-darwin8.8.1]

Any help would be great. Thanks.

Tom

Below is a more complete snippet of the code that I am using:

#!/usr/local/bin/ruby

require 'rubygems'
require 'opengl'

include Gl
include Glu
include Glut

class GlutTest

def initialize
puts "=== GlutTest.initialize ==="

@texture = glGenTextures(1).first

# Setup the GLUT display loop callback
@display = lambda do
glClear(Gl::GL_COLOR_BUFFER_BIT | Gl::GL_DEPTH_BUFFER_BIT)

gluOrtho2D(0.0, 128.0, 0.0, 128.0)

glutSwapBuffers
end

...

end

The issue was that the call to generate a texture must be inside of a
glut call back.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,800
Messages
2,569,656
Members
45,400
Latest member
BuyZapGuardian
Top