Peter Jones | 16 Apr 2013 23:20

OpenGL ES 2.0

I'm new to both Haskell and OpenGL so please forgive my ignorance and
feel free to correct any mistakes.

GHC cross-compiling to ARM (at least for iOS and maybe Android) is
currently being merged into mainline, making Haskell an attractive
language for desktop *and* mobile development.  This is still pretty
bleeding edge but, at least to me, very exciting.

I'm in the planning stages for a couple of applications that will have a
graphical game-like component to them.  I'd like to use Haskell and I've
also decided that since I need to support mobile devices the most
platform agnostic graphics library I can probably get away with is
OpenGL ES 2.0.

Since OpenGL ES 2.0 is based on OpenGL 2.0 with some modifications and a
proper subset of OpenGL 4.1 with the GL_ARB_ES2_compatibility extension,
I'm wondering if the current OpenGL package will work if I restrict
myself to the ES defined functions.  My research suggests that it won't
work because there are subtle differences between some of the function
names and other small incompatibilities.  One major difference being the
fact that OpenGL doesn't manage the window where drawing happens in ES.

If the existing packages won't work for this then I suppose I'll need to
write a new raw package for ES and provide some sort of shim layer to
OpenGL proper so that desktop applications can use the ES API.  My
initial thoughts for a raw package involve code generation, so I was
pretty happy when I stumbled upon the OpenGLRawgen repository.

At this point I'm looking to get some feedback on my approach and see if
anyone wants to work on this with me.
(Continue reading)

Jason Dagit | 18 Mar 2013 00:48
Picon
Gravatar

Important Update: Fold StateVar, ObjectName, and Tensor back into OpenGL

I realize this change may be frustrating for some users. I'm sorry about the inconveniences that it may cause. The positive side is that the Haskell Platform will be able to upgrade to the latest OpenGL bindings. I think that makes this disruption worth it.

Then new versions are not yet on hackage, but I'll probably upload them today.

How this will affect you:
I moved StateVar, ObjectName, and Tensor back into the OpenGL package (and renamed their modules from Data.* to Graphics.Rendering.OpenGL.GL.*). This also required a change in the GLUT package. I bumped the version number of OpenGL to 2.8.* and GLUT to 2.4.*.

The StateVar, Tensor, and ObjectName packages are still on hackage exactly as they were. So if you're using those they will continue to work except that GHC will see them as incompatible with the ones exported from Graphics.Rendering.OpenGL. If this is a problem then I can upload versions of those packages that are re-exports from OpenGL. The reason I haven't don that is because then those packages will depend on the OpenGL package and that seemed like a hassle (correct me if I'm wrong).

On the topic of GLUT, none of the examples explicitly import modules from StateVar, Tensor, or ObjectName so I didn't bother testing the examples. Properly testing the examples would be easiest if we had a cabal files for the examples. Then we could at least test that they build on travis-ci.

Jason

_______________________________________________
HOpenGL mailing list
HOpenGL <at> haskell.org
http://www.haskell.org/mailman/listinfo/hopengl
Michal J Gajda | 3 Mar 2013 14:26
Picon
Picon

Fwd: Vector operations on datatypes in Tensor library...

Dear All,


I see that Tensor library is used in OpenGL, OpenVG and few other libraries.
Is there any plan to make vector operations available? [E.g. dot and cross product, vector projection and rejection.]

Would you accept a patch, or would you recommend making another library? (Say Tensor-Operations:Data.Tensor.Operations.)

For now they are included in AC-Vector package that uses a different type, which leads to impedance mismatch and unnecessary copying.

I already contacted the maintainer of AC-Vector package, but got no answer to this problem so far.
--
  Best regards
    Michal



--
  Pozdrawiam
    Michał
_______________________________________________
HOpenGL mailing list
HOpenGL <at> haskell.org
http://www.haskell.org/mailman/listinfo/hopengl
Daniel Bergey | 20 Feb 2013 18:26
Picon
Favicon

GLSL interface

What is the recommended way to create and use a Shader object?
Graphics.Rendering.OpenGL.GL.Shaders.Shaders has a function createShader
which looks good, but is not exported.  Similar not-exported functions
seem to exist for the Program type.

If there's still work do be done on this part of the library, I can
to test out some code and submit a pull request.

Thanks,
bergey
Thiago Negri | 15 Jan 2013 15:58
Picon
Gravatar

Why OpenGL 3.2 bindings

Hello.

I'm quite new to OpenGL, so I don't know all features available.
The description of the OpenGLRaw package says it's a binding for OpenGL 3.2.
On the official site, the 3.2 specification version is from 2009. [1]

Why the Haskell binding uses version 3.2?
What OpenGL features I'm missing by using Haskell instead of C?

Thanks.


_______________________________________________
HOpenGL mailing list
HOpenGL <at> haskell.org
http://www.haskell.org/mailman/listinfo/hopengl
Jason Dagit | 4 Nov 2012 20:28
Picon
Gravatar

ANN: OpenGL packages update

The updates include:
  * All of the newtypes in OpenGLRaw have been changed to type aliases (credit to Trevor Elliott and Mike Ledger)
  * OpenGLRaw's TypesInternal module has gone away
  * NVidia path rendering extensions have been added by "ozelis" on github

This release changes OpenGLRaw to use type aliases instead of newtype wrappers for the GLfoo types, such as GLenum/GLfloat/GLdouble. Using newtypes had the following downsides:

  * The CPP macros to make these definitions are borrowed verbatim from GHC sources and required updates with new GHC releases in order to stay compatible. Although, it hasn't been a problem yet, it's conceivable this will conflict with supporting different versions of GHC at some point.
  * Optimization rules have to be written against these newtypes and forgetting them can lead to significant performance degradation or extra verbosity for people using the bindings.
  * You have to reach pretty deep into GHC to make it possible for the newtypes to work in the unboxed vectors provided by the vector package. This is again, another missed opportunity for high performance code.

You can find the source and bug trackers for these packages here: https://github.com/haskell-opengl/

Feedback, pull requests, and bug reports are always welcome!

Thanks!
Jason
_______________________________________________
HOpenGL mailing list
HOpenGL <at> haskell.org
http://www.haskell.org/mailman/listinfo/hopengl
Jason Dagit | 26 Oct 2012 07:25
Picon
Gravatar

Important changes to OpenGLRaw

Hello,


At some point in the past, OpenGLRaw was converted to use newtype wrappers for the GLfoo types, such as GLenum. I think this makes a certain amount of sense. It's certainly makes type safety easier.  There have also been significant downsides to this:

  * The CPP macros to make these definitions are borrowed verbatim from GHC sources and required updates with new GHC releases in order to stay compatible. Although, it hasn't been a problem yet, it's conceivable this will conflict with supporting different versions of GHC at some point.
  * Optimization rules have to be written against these newtypes and forgetting them can lead to significant performance degradation or extra verbosity for people using the bindings.
  * You have to reach pretty deep into GHC to make it possible for the newtypes to work in the unboxed vectors provided by the vector package. This is again, another missed opportunity for high performance code.

If you look at the current HEAD of the master branch for the OpenGLRaw code on github: https://github.com/haskell-opengl/OpenGLRaw

You will see some changes including:
  * All of the newtypes mentioned above have been changed to type aliases
  * Version bumped to 1.3.x
  * TypesInternal module has gone away

Thanks for these changes goes to Trevor Elliott.

If you think this move to type aliases is an error, please let me know (on list or personal email is fine). I'd like to do a push to Hackage sometime soon, but I want to give people a chance to comment first. By this time next week, I would like to post a new release, unless someone has an objection.

There is another wonderful set of changes you will find in HEAD. I received patches from "ozelis" to add support for the NVidia path rendering extension. Very cool!

Thanks!
Jason
_______________________________________________
HOpenGL mailing list
HOpenGL <at> haskell.org
http://www.haskell.org/mailman/listinfo/hopengl
Fabian Binz | 24 Aug 2012 14:07
Picon
Favicon

Raw generator and performance

Hi list,

 

I have two questions:

 

1. What is holding the release of OpenGLRawGen (see [1]) back? I tried it and it works quite well, although there seems to be a problem with at least some functions: glGenVertexArrays and the related functions are not exported by any core module, although it’s part of the core since OpenGL 3.0. I tried to find the source of this error in the code, but the codebase is quite big and I still don’t know where things go wrong.

 

2. Looking at the source of HSOpenGLRaw.c it seems to be quite costly to call OpenGL functions, because every time the function pointer has to be retrieved. Or does GetProcAdress (or the equivalent on Mac and Linux) cache previous results? Other librarys (like GLEW or gl3w for C) load the functions pointers once at initialization (which has of course to be done explicitly unlike in HOpenGL), which I guess is for efficiency reasons.

 

[1] http://www.haskell.org/pipermail/hopengl/2012-January/001073.html

_______________________________________________
HOpenGL mailing list
HOpenGL <at> haskell.org
http://www.haskell.org/mailman/listinfo/hopengl
梶本 裕介 | 23 Aug 2012 18:32

How to send matrices to GLSL uniform variables

Hi everyone,

In OpenGL 3.2, there is no fixed pipeline functionalities.
So I would like to send my model-view-projection matrix to GLSL through an uniform variable.
But I seem that there is no glUniformMatrix* family in HOpenGL.
(http://hackage.haskell.org/packages/archive/OpenGL/2.5.0.0/doc/html/Graphics-Rendering-OpenGL-GL-Shaders.html)
How can I achieve this?
Paul Visschers | 22 Jul 2012 11:38

Adding infix declaration to StateVar operators

Hey,


I would like to suggest adding an infixr 2 for the ($~), ($=!) and ($~!) operators in the StateVar package.

Paul
_______________________________________________
HOpenGL mailing list
HOpenGL <at> haskell.org
http://www.haskell.org/mailman/listinfo/hopengl
ai00rea | 6 May 2012 22:34
Picon
Favicon

Problem with Glut

I have to make a project for university. I want to make a little game like
Pong. For this I decided to use Glut. I followed this tutorial but I didn't
succeed: http://netsuperbrain.com/blog/posts/freeglut-windows-hopengl-hglut/

I am using Windows 7. Now I removed all things I installed from my computer
about haskell & openGL & GLUT. 
And I installed Haskell Platform. I found out that openGL and GLUT are
included in this platform. OK but there is one problem: 

GHCi, version 7.0.4: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package ffi-1.0 ... linking ... done.
[1 of 1] Compiling Main             (
C:\Users\fuRy\Desktop\openGL\teapots.hs, i
nterpreted )
Ok, modules loaded: Main.
*Main> main
Loading package OpenGL-2.2.3.0 ... linking ... done.
Loading package array-0.3.0.2 ... linking ... done.
Loading package containers-0.4.0.0 ... linking ... done.
Loading package GLUT-2.1.2.1 ... <interactive>: glut32: The specified module
cou
ld not be found.
can't load .so/.DLL for: glut32 (addDLL: could not load DLL)

Please help me. I tried 2 days to install this. Before that I tried to
instal WXHaskell too, and i failed. Or recomand me an library that you use
and there are some examples of code to figure out how to use it and is good
for my purpose: Pong.

--
View this message in context: http://haskell.1045720.n5.nabble.com/Problem-with-Glut-tp5689667.html
Sent from the Haskell - HOpenGL mailing list archive at Nabble.com.

Gmane