Giter Site home page Giter Site logo

glutil's Introduction

This is a small library of utilities for working with OpenGL.

Low-level wrappers are provided for filling BufferObjects, compiling
GLSL shader programs, and loading pixel data into OpenGL textures.

glutil's People

Contributors

acowley avatar bergey avatar fumieval avatar fuuzetsu avatar maoe avatar rabipelais avatar schell avatar traviswhitaker avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

glutil's Issues

"The program cpphs is required but it could not be found."

I got the below error trying to install GLUtil on OS X Mavericks. I understand there was an earlier, similar issue where the poster said they "had to install cpphs", but no further details were given for a solution. "cabal install cpphs" does not work for me, it claims cpphs is already installed. I tried --reinstall, but it gave me a scary message about everything being broken, so I did not go down that path.

I'd like to get this working, but am at a loss about what to do next. Am I missing something?

======= cabal install GLUtil:
Resolving dependencies...
Configuring GLUtil-0.7.4...

/var/folders/4b/1rj__m2j61d42z8fz4yqmhdm0000gn/T/68198.c:1:12:
warning: control reaches end of non-void function [-Wreturn-type]
int foo() {}
^
1 warning generated.
cabal: The program cpphs is required but it could not be found.
Failed to install GLUtil-0.7.4
cabal: Error: some packages failed to install:
GLUtil-0.7.4 failed during the configure step. The exception was:
ExitFailure 1

======= cabal install cpphs:
Resolving dependencies...
All the requested packages are already installed:
cpphs-1.18.4
Use --reinstall if you want to reinstall anyway.

Fails to build due to hpp error on nixos with ghc-8.0.1

This nix build shows the build failure: http://hydra.nixos.org/build/36545218

Here is the specific error message:

Building GLUtil-0.9.0.1...
Preprocessing library GLUtil-0.9.0.1...
hpp: Couldn't open input file: -include/tmp/nix-build-GLUtil-0.9.0.1.drv-0/ghc601_0/ghc_2.h
CallStack (from HasCallStack):

  error, called at src/Hpp/CmdLine.hs:89:0: error:
    22 in hpp-0.3.0.0-61vdEFyxUJDaeEBxsHCsL:Hpp.CmdLine
`hpp' failed in phase `C pre-processor'. (Exit code: 1)

There is another report of this on stack overflow: http://stackoverflow.com/questions/38062271/cabal-failed-to-install-glutil.

Broken with hopengl-2.9.0.0

In 2.9.0.0 TextureTarget no longer exists, but has be split into:
TextureTarget1D
TextureTarget2D
TextureTarget3D

How to Install

I'm sorry, I'm new to Haskell. I don't understand how to install this at all. Google turns up nothing, and this isn't in hackage, and it seems like every other Haskell library assumes cabal.

Shader info log with \NUL

loadShaderBS could print shader info log messages more than necessary because apparently shaderInfoLog could return a non-empty string that contains only a null character. I guess we should fix OpenGL package not to return null-terminated strings in the first place. Alternatively we could fix GLUtil to check if infoLog contains only a null character.

What do you think?

Examples didn't compile: ambiguous occurences everywhere

I tried to run the opengl examples found in the repo (examples/lesson3b.hs). With self-compiled haskell-platform, ghc 7.0. 4 on ubuntu 10.10, the examples kept reporting compile error of "ambiguous occurrence". The conflict came from "> import Graphics.Rendering.OpenGL" and "> import Graphics.UI.GLUT". Interestingly all other running codes started reporting such errors after GLUtil was installed. It does seem to me that installing GLUtil lead to the error.

Any thoughts? Also could you provide more detail on what environment you were testing your examples with? Thanks!

Missing dependency? cpphs

Before installing GLUtil I had to install the package cpphs (which is some preprocessor). Could this be a missing dependency, or is my haskell installation outdated?

Configuring GLUtil-0.7.1...
cabal.exe: The program cpphs is required but it could not be found.
Failed to install GLUtil-0.7.1
cabal.exe: Error: some packages failed to install:
GLUtil-0.7.1 failed during the configure step. The exception was:
ExitFailure 1

Fix containers version in GLUtil.cabal

It should be probably >= 0.5. I use GHC 7.4 (from haskell platform) and GLUtils does not compiles becouse of missing Data.Map.Strict module unless I write "build-depends: containers >= 0.5" in my .cabal file.

Inconsistent rotations for Camera3D

The panRad function pre-multiplies the new rotation to the old orientation, while tiltRad and rollRad post-multiply it. This leads, for example, to the following unexpected behaviour:

  • roll 90 degrees to the right
  • now tilting up and panning right give the exact same behaviour, which is rotating upwards (with respect to the rotated camera). This makes sense for tilting, not so much for panning.

Is this behaviour desired?

freshTextureFloat internal format is not RGBA32F

The freshTextureFloat function, which I expected to generate a texture with an internal format of 32-bit floats for each channel, instead had a format of 8-bit unsigned integers.

This is because the PixelInternalFormat is specified as RGBA', which seems to indicate an 8-bit normalized internal format, rather than RGBA32F (in Textures.hs, line 114).

Is this intended behaviour, or should it be changed? Should an option for manually specifying the pixel format be added?

Supply texture target to reloadTexture

I'd like to handle cubemap textures, but reloadTexture function is supposed to be applied only for Texture2D targets. Can we provide to it one more argument with a type TwoDimensionalTextureTarget t, so it will be more generalized?

Create a GLUtilRaw

I was using OpenGL package and had to switch over to OpenGLRaw because of haskell-opengl/OpenGL#33

I think it will be great to split this package and create a GLUtilRaw that uses only OpenGLRaw types.
Then use GLUtilRaw in GLUtil to give the higher types of OpenGL.

compile error. Example should be updated?

ghc example1.hs
[2 of 2] Compiling Main ( example1.hs, example1.o )

example1.hs:101:16: Not in scope: ‘initialize’

example1.hs:102:16: Not in scope: ‘openWindow’

example1.hs:105:16: Not in scope: ‘defaultDisplayOptions’

example1.hs:105:40:
‘displayOptions_width’ is not a (visible) constructor field name

example1.hs:106:40:
‘displayOptions_height’ is not a (visible) constructor field name

example1.hs:107:40:
‘displayOptions_refreshRate’ is not a (visible) constructor field name

example1.hs:111:19: Not in scope: ‘keyIsPressed’

example1.hs:111:32: Not in scope: data constructor ‘KeyEsc’

The type of setUniform

It seems like setUniform should have the type AsUniform a => ShaderProgram -> String -> a -> IO () for consistency with asUniform. One of the main benefits of using this library is to be able to use linear's types instead of the GL package's ones.

ImageYCbCr8 support

You can decode JPEG textures like this:

import Codec.Picture
import Codec.Picture.Types

Right (ImageYCbCr8 img) <- readImage "file.jpg"
let (Image w h p) = convertImage img :: Image PixelRGB8
tex <- loadTexture (texInfo w h TexRGB p)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.