[Haskell-cafe] Anyone know why this always returns invalid texture objects?

Jefferson Heard jefferson.r.heard at gmail.com
Thu Nov 6 17:08:39 EST 2008

import Graphics.UI.Gtk
import Graphics.UI.Gtk.Glade
import Graphics.UI.Gtk.OpenGL
import qualified Graphics.Rendering.OpenGL as GL
import Graphics.Rendering.OpenGL (($=))

main = do
  GL.shadeModel $= GL.Flat
  GL.depthFunc $= Just GL.Less
  (window1,gui,dlgs) <- constructGUIObject
  (sX, sY) <- liftM (mapPair fromIntegral) . widgetGetSize .
drawing_canvas $ gui -- get the canvas size for determining the part
of the widget to repaint
  pb <- pixbufNew ColorspaceRgb False 8 (round pbWidth) (round pbHeight)
  pixbufFill pb 0 0 0 255
  pxbufs <- initSubpixbufs pb texRows texCols
  textures <- GL.genObjectNames (texRows*texCols)
  print textures

I try to take things like a crow; war and chaos don't always ruin a
picnic, they just mean you have to be careful what you swallow.

-- Jessica Edwards

More information about the Haskell-Cafe mailing list