r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[rogle] REBOL OpenGL/GLut Extension

Maxim
20-Aug-2009
[1x4]
hi all, I am currently building a wrapper for the OpenGL / GLut libraries 
to allow R3 apps to access OpenGL natively.
so far I haven't had any problems with the R3 side of things including 
compiling my own extension with a few new funcs in it...


But now I'm starting to implement the GL specifics and just hit a 
snag.
GLut  needs access to the application's (argc, argv)... I've tried 
simulating this, following guidelines I've found on how they are 
supposed to be setup when supplied to the app, but so far, the glut 
init just seems to crash on me.   :-(
MILESTONE !!!  I've got an OpenGL window up and running... called 
from within REBOL  3  :-)
Henrik
20-Aug-2009
[5]
screenshot?
Graham
20-Aug-2009
[6]
what's it good for?  better forms?
Maxim
20-Aug-2009
[7x2]
screenshot not yet usefull... still doing the low-level stuff (no 
way to specify polygons yet... but should be done shortly)
graham, This will allow us to do Hardware-accelerated 2D/3D directly 
from REBOL.
Graham
20-Aug-2009
[9]
I thought geomol already did something with opengl?
Maxim
20-Aug-2009
[10x3]
when Carl adds a few little image! enhancements to the extension 
API, I should be able to use a rebol image! as the interface to get 
the OpenGL render into rebol, using R3 view.  If memcopy works, then 
it should be VERY fast ( a few hundred images/second AFAICT)
yes Geomol did, but the limitations of R2 can't make it native... 
meaning, you don't have access to the binary part of the data and 
use it directly within normal datatypes.
the goal is to have an OpenGL gob :-)
Geomol
20-Aug-2009
[13]
Cool! :-)
Maxim
20-Aug-2009
[14x2]
first step is to have an image! which is updated from the OpenGL 
rendering using high-performance memory copy functions from the C 
side..
I've been waiting sooooo many years to be able to do just what I 
am doing now  :-)
Will
20-Aug-2009
[16]
woot.. this R3.. now I got to learn C, OpenGL, etc.. 8))
Maxim
20-Aug-2009
[17]
:-)
Henrik
20-Aug-2009
[18x3]
Maxim, I'm sure Carl will love it, if you can provide the same underpinnings 
for VID via OpenGL as through the current engine.
(and in a few KBs)
I'd love to see how 10000 cows performs :-)
Maxim
20-Aug-2009
[21x2]
yep... right now I'm working on primitives... shaded cube is the 
first one... just to show off its in 3D  :-)
with current cards... why not jump directly to a million cows  :-D
Graham
20-Aug-2009
[23]
only good for games then?
Maxim
20-Aug-2009
[24]
I need to wait for callback and/or image! specific enhancements to 
API to make it REBOL controlable
Graham
20-Aug-2009
[25x2]
Can we have 3D UIs ?
Anton did a 3D GUI demo ... useful for that?
Henrik
20-Aug-2009
[27]
Graham, if it can do what GOBs are doing now, it will be fine for 
VID3.4. It's a matter of how you design the interface, I suppose.
Maxim
20-Aug-2009
[28x2]
my use for this is to replace VID, for Elixir OS.  which is a fully 
3 dimensional interface design.
buttons really stick out, project shadows, etc... flip the window 
to see what is behind it,  desk surface is liquid... so things can 
be made to float... with water ripples, etc.
Graham
20-Aug-2009
[30]
mimic the iphone?
Maxim
20-Aug-2009
[31]
I also have a client which needs to visualize genomic data and millions 
of nodes in space.... so this is the first step to getting that contract 
 :-)
Graham
20-Aug-2009
[32]
Create my favourite avatar, Max Headroom :)
Maxim
20-Aug-2009
[33x5]
hehe
I also need the OpenGL performance for a huge art project of mine 
which composites thousands of pictures.
anyways... screenshot in a  few minutes  :-:
trying to add texture just for the fun of it  :-)
The first REBOL natively Generated OpenGL hardware accelerated graphics. 
    :-D

http://www.pointillistic.com/open-REBOL/moa/steel/R3-OGL.png
Henrik
20-Aug-2009
[38x2]
wohoo! :-)
what does the REBOL source look like?
ICarii
20-Aug-2009
[40]
very nice maxim! :)
Maxim
20-Aug-2009
[41x4:last]
Open GL gfx source is mostly  on the C side for now because I'm still 
playing around with the extension and I can't interact with GLut 
or OGL until the extension API is expanded a little bit.
rebol [
	title: "test roggle"
]

secure [extension allow]
r: import %rogle.dll

rogl-init [ ]
rogl-draw-cube
rogl-window

ask "..."

quit
At this point, providing the full capabilities of OpenGL to REBOL 
seems trivial, once the image! improvements are added to Extensions 
API.


Some form of callbacks would also allow us to use a different window 
manager than VID (which would make it faster, since we wouldn't need 
to convert to rebol bitmaps at each frame).
(note that the GLut window manager is already available on most OSes, 
so this makes it even simpler to port, once extensions are ported 
to other platforms.  :-)