Code Monkey home page Code Monkey logo

glut's People

Contributors

andreasabel avatar dagit avatar dcoutts avatar dylex avatar ekmett avatar elliottt avatar igfoo avatar lehins avatar nh2 avatar peti avatar rosievers avatar rumblesan avatar ryanglscott avatar svenpanne avatar tristancacqueray avatar zenzike 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  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

glut's Issues

opengl/GLUT from ghci on Mac OS 10.9.2 with ghc 7.8.2

I'd like to be able to use opengl/GLUT from the ghci prompt. On Mac OS 10.9.2 with ghc 7.8.2 once I invoke main on the programs in the tutorial at http://www.haskell.org/haskellwiki/OpenGLTutorial1 or http://www.haskell.org/haskellwiki/OpenGLTutorial2 I can't get back to the ghci prompt, all I can do is Quit out of the icon in the doc which kills my Haskell program. Starting ghci with -fno-ghci-sandbox doesn't help.

Is this how it is supposed to work or is this a bug? At http://www.haskell.org/haskellwiki/OpenGLTutorial1 it does say: "Alas, on some platforms GHCi has problems running the following programs, so you might have to compile them with GHC and run the generated executables instead." but it gives no details on which platforms and what ghc versions this occurs and what the symptoms are. Nor does it refer to a ghc ticket or any other bug report.

I had problems in the past with with this, generally crashes with segmentation faults. I got the impression that this would be fixed with dynamic linking in 7.8.2 so trying again. There is a discussion on the ghc-devs mailing list of dynamic linking, foreign libraries and ghci on ghc dev so it would be great if any of the maintainers could join that discussion and give your thoughts and details of your experience and the current status on 7.8.2

Linking with freeGLUT on OSX

I'm currently building a project on OSX and finding that I can't actually get freeGLUT linking. The installed system version of GLUT is always being used.

Just to confuse matters, I'm also using stack to build and have install freeGLUT with brew.

I realise that OSX is its own special flavour of awkward for this type of thing, but I feel like there should just be some ghc-options flags that I should be able to pass that will make it clear I want to build against freeGLUT and not the system framework. Just can't seem to figure out what they are.

Currently I'm telling stack to explicitly pass ghc the -lGLUT flag, but that doesn't seem to be doing the trick.
https://github.com/rumblesan/improviz/blob/master/stack.yaml#L62-L69

Build issue on macos aarch64

When I enable a single example in the cabal file and try to build I get the following error:

Build profile: -w ghc-9.8.2 -O1
In order, the following will be built (use -v for more details):
 - GLUT-2.7.0.16 (lib) (configuration changed)
 - GLUT-2.7.0.16 (exe:RedBook4-Hello) (configuration changed)
Configuring library for GLUT-2.7.0.16..
Preprocessing library for GLUT-2.7.0.16..
Building library for GLUT-2.7.0.16..
Configuring executable 'RedBook4-Hello' for GLUT-2.7.0.16..
Preprocessing executable 'RedBook4-Hello' for GLUT-2.7.0.16..
Building executable 'RedBook4-Hello' for GLUT-2.7.0.16..
[2 of 2] Linking /Users/xyz/proj/GLUT/dist-newstyle/build/aarch64-osx/ghc-9.8.2/GLUT-2.7.0.16/x/RedBook4-Hello/build/RedBook4-Hello/RedBook4-Hello
ld: Absolute addressing not allowed in arm64 code but used in '_Lcapw_info' referencing '_GLUTzm2zi7zi0zi16zminplace_GraphicsziUIziGLUTziRawziCallbacks_makeDisplayFunc1_closure'
clang-16: error: linker command failed with exit code 1 (use -v to see invocation)
ghc: `clang' failed in phase `Linker'. (Exit code: 1)
Error: cabal: Failed to build exe:RedBook4-Hello from GLUT-2.7.0.16.

`ghci` exits on close window in glut

I try the minimal hello-world in glut (copied from the wiki) and run it in ghci.
When I close the window (esc is not available) ghci closes.

Is there a procedure to have glut run in ghci repeatedly? Thank you!

GHCi, version 8.10.7
GLUT 2.7.0.16
haskell ghc-8.10.7

Typo in documentation?

-- | (/freeglut only/) For a bitmap font, return the maximum height of the
-- characters in the given font measured in pixels. For a stroke font,
-- return the width in units.
fontHeight :: MonadIO m => a -> m GLfloat

For a stroke font, return the width in units.

Should this be: "For a stroke font, return the height in units."

RedBook8 example

Hi, I got tripped up by stride when trying to modify this example to use Vertex4s instead of Vertex2s. I suggest a change such that stride is calculated:

  let firstIndex = 0
      vPosition = AttribLocation 0
  vertexAttribPointer vPosition $=
    (ToFloat, VertexArrayDescriptor 2 Float (fromIntegral $ sizeOf (head vertices)) (bufferOffset firstIndex))
  vertexAttribArray vPosition $= Enabled

Defaults to FreeGLUT on macOS

This package automatically uses freeglut on macOS Sierra 10.12.5, which is unpractical, since using FreeGLUT on a mac means that you have to install a X server. The changelog only states that it is possible to link against FreeGLUT, while it seems to be selected AND INSTALLED by default, which is also strange, since GLUT is shipped with macs. Is there a compilation flag to prevent that, or anything?

Trouble building applications with Haskell GLUT and freeglut on OS X with GHC 7.10.1

When I depend on the GLUT Haskell package (2.6 or newer) on GHC 7.10.1 on OS X 10.9.5, the GLUT package builds and installs successfully, but applications that depend on GLUT fail during cabal install with this kind of linking error:

<command line>: can't load .so/.DLL for: .../.cabal-sandbox/lib/x86_64-osx-ghc-7.10.1/GLUT_99KmPk9UqZy96uvbsgIYcH/libHSGLUT-2.6.0.1-0sykGmIsSqkEsQwajDtfCI-ghc7.10.1.dylib (dlopen(.../.cabal-sandbox/lib/x86_64-osx-ghc-7.10.1/GLUT_99KmPk9UqZy96uvbsgIYcH/libHSGLUT-2.6.0.1-0sykGmIsSqkEsQwajDtfCI-ghc7.10.1.dylib, 5):
  Symbol not found: _glutBitmap8By13
  Referenced from: .../.cabal-sandbox/lib/x86_64-osx-ghc-7.10.1/GLUT_99KmPk9UqZy96uvbsgIYcH/libHSGLUT-2.6.0.1-0sykGmIsSqkEsQwajDtfCI-ghc7.10.1.dylib
  Expected in: flat namespace
 in .../.cabal-sandbox/lib/x86_64-osx-ghc-7.10.1/GLUT_99KmPk9UqZy96uvbsgIYcH/libHSGLUT-2.6.0.1-0sykGmIsSqkEsQwajDtfCI-ghc7.10.1.dylib)

I'm not sure whether this is GHC's fault or an interaction between OS X, GHC 7.10.1, etc., but this seemed like a good place to report this.

bytestring dep. version bump (0.10.0.2 -> 0.10.4.0)

Can we bump the Data.ByteString version to 0.10.4.0 ? Currently, attempts to compile with ByteString 0.10.4.0 installed, lead to the following error:

Prelude> :load "examples/RedBook8/Chapter01/LoadShaders.hs"
[1 of 1] Compiling LoadShaders ( examples/RedBook8/Chapter01/LoadShaders.hs, interpreted )

examples/RedBook8/Chapter01/LoadShaders.hs:46:12:
Couldn't match type bytestring-0.10.0.2:Data.ByteString.Internal.ByteString' withB.ByteString'
Expected type: T.Text -> B.ByteString
Actual type: T.Text
-> bytestring-0.10.0.2:Data.ByteString.Internal.ByteString
In the first argument of (.)', namelyTE.encodeUtf8'
In the expression: TE.encodeUtf8 . T.pack
In an equation for `packUtf8': packUtf8 = TE.encodeUtf8 . T.pack

examples/RedBook8/Chapter01/LoadShaders.hs:75:32:
Couldn't match expected type bytestring-0.10.0.2:Data.ByteString.Internal.ByteString' with actual typeB.ByteString'
In the second argument of ($=)', namelysrc'
In a stmt of a 'do' block: shaderSourceBS shader $= src
In the expression:
do { src <- getSource source;
shaderSourceBS shader $= src;
compileAndCheck shader;
attachShader program shader;
.... }
Failed, modules loaded: none.

Can't use fonts in OpenGL

Hi, when I want to use any of the inbuilt fonts, with runghc or ghci, I get:

Prelude Main> freeglut (<interactive>): stroke font 0x45f37b20 not found

This seems to be known at least to the Gloss people.

Using ghci is important for what I'm trying to do with this, so I cannot just use ghc for it unfortunately.

Is there anything we can do about this? Do you know what the restriction here is?

Package on Hackage

Hi

GLUT on Hackage has not been updated since February 5, and does not compile with GHC 7.6.

Graphics.UI.GLUT.Raw no longer exposed!

Many of the functions in Graphics.UI.GLUT.Raw.Functions are very useful and necessary; an example pertinant to my project is glutIgnoreKeyRepeat. The decision to move Graphics.UI.GLUT.Raw and submodules to the other-modules section, thus, leaves me with no way to call those very useful low level bindings without either making bindings to them in my own project or modifying this package locally.

What was the motivation for this change? Can we get it changed back?

Typo in Begin.hs -> ActionOnWindowClose -> ContinueExectuion

This should be ContinueExecution. If there's a good way to fix this without breaking things, that would be good. One possibility is adding a correctly spelled constructor which mimics the behavior, but having ContinueExecution and ContinueExectuion do the same thing might be confusing. Maybe do that and mark ContinueExectuion deprecated.

ghci: unknown GLUT entry glutFOO, GHC 7.10.3

GLUT version is 2.7.0.6, this feels related to the https://ghc.haskell.org/trac/ghc/ticket/10568 saga.

dlsym (used by hs_GLUT_getProcAddress) does not find glutInit, however the framework is actually loaded. Compiled binaries work fine.

Prelude> :m +Graphics.UI.GLUT
Prelude Graphics.UI.GLUT> getArgsAndInitialize
*** Exception: user error (unknown GLUT entry glutInit)

...
Prelude Graphics.UI.GLUT System.Posix.DynamicLinker> dlsym Default "glutInit"
*** Exception: user error (dlsym: dlsym(RTLD_DEFAULT, glutInit): symbol not found)

Starting ghci with DYLD_INSERT_LIBRARIES=/System/Library/Frameworks/GLUT.framework/GLUT serves as a workaround, however I'm not sure what's the best way to resolve this problem properly.

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.