1. Win32Lib + OpenGL = Love

I've posted some source code at

    http://www.cklester.com/euphoria/eu_opengl.htm

Some of the code is buggy, but I'm stuck at this
point and I'd like to get everybody's help to make
it rock solid and ready for public consumption. :)

-=ck
"Programming in a state of EUPHORIA."
http://www.cklester.com/euphoria/

new topic     » topic index » view message » categorize

2. Re: Win32Lib + OpenGL = Love

cklester wrote:
> 
> I've posted some source code at
> 
>     <a
>     href="http://www.cklester.com/euphoria/eu_opengl.htm">http://www.cklester.com/euphoria/eu_opengl.htm</a>
> 
> Some of the code is buggy, but I'm stuck at this
> point and I'd like to get everybody's help to make
> it rock solid and ready for public consumption. :)
> 
> -=ck
> "Programming in a state of EUPHORIA."
> <a
> href="http://www.cklester.com/euphoria/">http://www.cklester.com/euphoria/</a>

Hi ck,
Perhaps you could upload it to Rob's server?  I get:
  "Cannot find server or DNS Error"

Every other URL I've tried is working here...

-- Brian

new topic     » goto parent     » topic index » view message » categorize

3. Re: Win32Lib + OpenGL = Love

Brian Broker wrote:
> 
> cklester wrote:
> > 
> > I've posted some source code at
> > 
> >     <a
> >     href="http://www.cklester.com/euphoria/eu_opengl.htm">http://www.cklester.com/euphoria/eu_opengl.htm</a>
> > 
> > Some of the code is buggy, but I'm stuck at this
> > point and I'd like to get everybody's help to make
> > it rock solid and ready for public consumption. :)
> > 
> > -=ck
> > "Programming in a state of EUPHORIA."
> > <a
> > href="http://www.cklester.com/euphoria/">http://www.cklester.com/euphoria/</a>
> 
> Hi ck,
> Perhaps you could upload it to Rob's server?  I get:
>   "Cannot find server or DNS Error"
> 
> Every other URL I've tried is working here...
> 
> -- Brian
> 


Hi

I get connection refused.

I am playing (very very slowly) with model loading in opengl,
using basic4gl for testing - much simpler syntax, but translatable to 
eu. Essentially, it seems if you can load a list of polys into
opengl, you can display a model, and model files seem to be just that.
(Correct me if I'm wrong! - please!)

Chris

new topic     » goto parent     » topic index » view message » categorize

4. Re: Win32Lib + OpenGL = Love

I wrote:
> Hi ck,
> Perhaps you could upload it to Rob's server?  I get:
>   "Cannot find server or DNS Error"
> 
> Every other URL I've tried is working here...
> 
> -- Brian
> 

OK, nevermind, working now...
-- Brian

new topic     » goto parent     » topic index » view message » categorize

5. Re: Win32Lib + OpenGL = Love

Hi

Yup, me too.

Couple of points, probably mentioned somewhere, just not read fm yet.

1. Needs Truegl library, and definately current win32lib - if (like me)
you installed truegl into a folder, along with win32lib supplied with 
truegl it won't work - delete all the old win32 lib files in the true gl
folder.

2. Need spindisc and extra controls library.

3. Need to modify the line on line 120 of the euphoria_opengl.exw file
from
setBitmap(
txt_spinFactor,"E:\\apps\\euphoria\\FutureView2\\openGLTest\\eugl.bmp")
to
setBitmap( txt_spinFactor,"eugl.bmp")
so that it will load from current folder

4. Once you have removed the old win32lib from truegl, truegl actually slows
down.

And when is word wrapping going to be implemented in this message box!!!!

Nice job!

Chris

new topic     » goto parent     » topic index » view message » categorize

6. Re: Win32Lib + OpenGL = Love

Chris,

Thanks for the heads-up on that stuff. I knew I was going to forget
something, and the slow-down with Win32Lib is interesting. I'll have
to find time to investigate. :)

-=ck
"Programming in a state of EUPHORIA."
http://www.cklester.com/euphoria/

new topic     » goto parent     » topic index » view message » categorize

7. Re: Win32Lib + OpenGL = Love

Chris Burch wrote:

> 1. Needs Truegl library, and definitely current win32lib
> 2. Need spindisc and extra controls library.

Okay, this is now clearly noted.

> 3. Need to modify the line on line 120 of the euphoria_opengl.exw file
> from
> setBitmap(
> txt_spinFactor,"E:\\apps\\euphoria\\FutureView2\\openGLTest\\eugl.bmp")
> to
> setBitmap( txt_spinFactor,"eugl.bmp")
> so that it will load from current folder

That line gets written by Judith's IDE, so I adjusted it in the
separate *.exw file, but I don't think I can change that in the IDE's
*.prj file.

-=ck
"Programming in a state of EUPHORIA."
http://www.cklester.com/euphoria/

new topic     » goto parent     » topic index » view message » categorize

8. Re: Win32Lib + OpenGL = Love

Chris Burch wrote:
> 
> I am playing (very very slowly) with model loading in opengl,
> using basic4gl for testing - much simpler syntax, but translatable to 
> eu.

The syntax seems to be the same.

Here's sample code in Basic4GL:

glBegin (GL_TRIANGLES)
   glVertex3f (0, 10, -30)
   glVertex3f (8, -4, -30)
   glVertex3f (-8, -4, -30)
glEnd ()

Here's the same code as used in Euphoria with truegl by Daniel Kluss:

glBegin (GL_TRIANGLES)
   glVertex3f (0, 10, -30)
   glVertex3f (8, -4, -30)
   glVertex3f (-8, -4, -30)
glEnd ()

Yes, they're identical! :)

Also, Evan Marshall has done a huge amount of work translating
the NeHe OpenGL demos into Euphoria. These are a must see for
anybody contemplating using Euphoria and OpenGL.

    http://nehe.gamedev.net/

At the bottom of many of the lessons you'll find a list
of translations done into different languages, including Euphoria!

-=ck
"Programming in a state of EUPHORIA."
http://www.cklester.com/euphoria/

new topic     » goto parent     » topic index » view message » categorize

9. Re: Win32Lib + OpenGL = Love

cklester wrote:
> 
> Chris Burch wrote:
> > 
> > I am playing (very very slowly) with model loading in opengl,
> > using basic4gl for testing - much simpler syntax, but translatable to 
> > eu.
> 
> The syntax seems to be the same.
> 
> Here's sample code in Basic4GL:
> 
> glBegin (GL_TRIANGLES)
>    glVertex3f (0, 10, -30)
>    glVertex3f (8, -4, -30)
>    glVertex3f (-8, -4, -30)
> glEnd ()
> 
> Here's the same code as used in Euphoria with truegl by Daniel Kluss:
> 
> glBegin (GL_TRIANGLES)
>    glVertex3f (0, 10, -30)
>    glVertex3f (8, -4, -30)
>    glVertex3f (-8, -4, -30)
> glEnd ()
> 
> Yes, they're identical! :)
> 
> Also, Evan Marshall has done a huge amount of work translating
> the NeHe OpenGL demos into Euphoria. These are a must see for
> anybody contemplating using Euphoria and OpenGL.
> 
>     <a href="http://nehe.gamedev.net/">http://nehe.gamedev.net/</a>
> 
> At the bottom of many of the lessons you'll find a list
> of translations done into different languages, including Euphoria!
> 
> -=ck
> "Programming in a state of EUPHORIA."
> <a
> href="http://www.cklester.com/euphoria/">http://www.cklester.com/euphoria/</a>
> 


Hi

Yes, you're right! Dammit. Heres my lines

for i = 1 to 100 do
puts(1, "I must never question my betters, and always check my
     definitions")
end for


Seriously though, if you put those 5 lines into basic4gl program, it runs,
lets see the equivalent _entire_ eu program. I'm beginning to understand
opengl, but definately floundering with the (various) eu manifectations
of it.

Anyway, thanks again for the nice work - I'm going to keep on floundering - 
lol.

Chris

and when are we going to get word wrapping on this bally thing!

new topic     » goto parent     » topic index » view message » categorize

10. Re: Win32Lib + OpenGL = Love

Chris Burch wrote:
> cklester wrote:
> > Chris Burch wrote:
> > > I am playing (very very slowly) with model loading in opengl,
> > > using basic4gl for testing - much simpler syntax, but translatable to 
> > > eu.
> > The syntax seems to be the same.
> > Here's sample code in Basic4GL:
> > glBegin (GL_TRIANGLES)
> >    glVertex3f (0, 10, -30)
> >    glVertex3f (8, -4, -30)
> >    glVertex3f (-8, -4, -30)
> > glEnd ()
> > Here's the same code as used in Euphoria with truegl by Daniel Kluss:
> > glBegin (GL_TRIANGLES)
> >    glVertex3f (0, 10, -30)
> >    glVertex3f (8, -4, -30)
> >    glVertex3f (-8, -4, -30)
> > glEnd ()
> 
> Seriously though, if you put those 5 lines into basic4gl program, it runs,
> lets see the equivalent _entire_ eu program. I'm beginning to understand
> opengl, but definately floundering with the (various) eu manifectations
> of it.

-- start code
include openGLstuff.ew

glBegin (GL_TRIANGLES)
  glVertex3f (0, 10, -30)
  glVertex3f (8, -4, -30)
  glVertex3f (-8, -4, -30)
glEnd ()
-- end code

:D

-=ck
"Programming in a state of EUPHORIA."
http://www.cklester.com/euphoria/

new topic     » goto parent     » topic index » view message » categorize

11. Re: Win32Lib + OpenGL = Love

cklester wrote:
> 
> Chris Burch wrote:
> > cklester wrote:
> > > Chris Burch wrote:
> > > > I am playing (very very slowly) with model loading in opengl,
> > > > using basic4gl for testing - much simpler syntax, but translatable to 
> > > > eu.
> > > The syntax seems to be the same.
> > > Here's sample code in Basic4GL:
> > > glBegin (GL_TRIANGLES)
> > >    glVertex3f (0, 10, -30)
> > >    glVertex3f (8, -4, -30)
> > >    glVertex3f (-8, -4, -30)
> > > glEnd ()
> > > Here's the same code as used in Euphoria with truegl by Daniel Kluss:
> > > glBegin (GL_TRIANGLES)
> > >    glVertex3f (0, 10, -30)
> > >    glVertex3f (8, -4, -30)
> > >    glVertex3f (-8, -4, -30)
> > > glEnd ()
> > 
> > Seriously though, if you put those 5 lines into basic4gl program, it runs,
> > lets see the equivalent _entire_ eu program. I'm beginning to understand
> > opengl, but definately floundering with the (various) eu manifectations
> > of it.
> 
> -- start code
> include openGLstuff.ew
> 
> glBegin (GL_TRIANGLES)
>   glVertex3f (0, 10, -30)
>   glVertex3f (8, -4, -30)
>   glVertex3f (-8, -4, -30)
> glEnd ()
> -- end code
> 
> :D
> 
> -=ck
> "Programming in a state of EUPHORIA."
> <a
> href="http://www.cklester.com/euphoria/">http://www.cklester.com/euphoria/</a>
> 


Hi

Sorry, couldn't resist this smile

Above program returns ex.err

D:\EUPHORIA\010_Graphics_Gaming\TRUEGL2\basic_tri.exw:2
can't find openGLstuff.ew in D:\EUPHORIA\010_Graphics_Gaming\TRUEGL2 
or in d:\euphoria\include
include openGLstuff.ew

See what I mean!

Chris

new topic     » goto parent     » topic index » view message » categorize

12. Re: Win32Lib + OpenGL = Love

Chris Burch wrote:
> cklester wrote:
> > -- start code
> > include openGLstuff.ew
> > 
> > glBegin (GL_TRIANGLES)
> >   glVertex3f (0, 10, -30)
> >   glVertex3f (8, -4, -30)
> >   glVertex3f (-8, -4, -30)
> > glEnd ()
> > -- end code
> 
> Above program returns ex.err

Well, duh! It was pseudo-code. :) I was just showing that with the
right library, the code can be somewhat the same. However, despite
the fact that  such a library is possible,  I don't think there is
yet such a library. :/

(But once that's complete, you can use what I wrote.)

Euphoria's way, ultimately, might not be as simple as Basic4GL's
way, but I'm guessing that Euphoria will be more versatile and
faster, not only in developing but in execution.

-=ck
"Programming in a state of EUPHORIA."
http://www.cklester.com/euphoria/

new topic     » goto parent     » topic index » view message » categorize

13. Re: Win32Lib + OpenGL = Love

cklester wrote:
> 
> Well, duh! It was pseudo-code. :) I was just showing that with the
> right library, the code can be somewhat the same. However, despite
> the fact that  such a library is possible,  I don't think there is
> yet such a library. :/
> 
> (But once that's complete, you can use what I wrote.)
> 
> Euphoria's way, ultimately, might not be as simple as Basic4GL's
> way, but I'm guessing that Euphoria will be more versatile and
> faster, not only in developing but in execution.
> 
> -=ck
> "Programming in a state of EUPHORIA."
> <a
> href="http://www.cklester.com/euphoria/">http://www.cklester.com/euphoria/</a>
> 
Hi

Fits of hysterical laughter!

Yes, I know. Euphoria is a far more versatile and beatiful language, and the
work
that you and all the other openglers are doing is brilliant, and I can only
hope that one day I am able to scrawl opengl/euphoria code as well as you
do.

However, I'm an opengl noob, and basic4gl, while being a very limiting language,
is eminently suitable to learning the principles of opengl.

Thanks for a very entertaining thread CK.

BTW, small challenge, what would the code be for generating one white 
triangle, fullscreen, centred and slightly translated into the screen,
only using truegl as an include, and NO others. I've been struggling
with this for 24 hours, no doubt 5 mins to you ( smile )

Regards

Chris

new topic     » goto parent     » topic index » view message » categorize

14. Re: Win32Lib + OpenGL = Love

Chris Burch wrote:
> 
> BTW, small challenge, what would the code be for generating one white 
> triangle, fullscreen, centred and slightly translated into the screen,
> only using truegl as an include, and NO others. I've been struggling
> with this for 24 hours, no doubt 5 mins to you ( smile )

Since truegl depends on Win32Lib for its GUI, you have to include win32lib.
You can use mic's opengl code, or evan marshall's opengl code, if you don't
want to use win32lib.

Anyway, here's code for drawing a simple quad on a fullscreen in windows:

--start of simple OpenGL code
include Win32Lib.ew
include truegl.e

--create the window
constant win = createEx( Window, "EUPHORIA + OpenGL Demo - Triangle", 0,
Default, Default, 640, 480, {WS_POPUP, WS_DLGFRAME}, 0 )

-- draw our quadrangle
procedure display()
    glClear(GL_COLOR_BUFFER_BIT + GL_DEPTH_BUFFER_BIT)
    glLoadIdentity()
    glTranslatef(0.0,0.0,-4.0)
    glBegin(GL_QUADS)
    	glVertex3f(-1.0, -1.0,  1.0)
    	glVertex3f( 1.0, -1.0,  1.0)
    	glVertex3f( 1.0,  1.0,  1.0)
    	glVertex3f(-1.0,  1.0,  1.0)
    glEnd()
    special_SwapBuffers()
end procedure

--set up our environment when we start
procedure win_onOpen (integer self, integer event, sequence params)
init_opengl_window(win,or_all({PFD_DOUBLEBUFFER,PFD_GENERIC_ACCELERATED}),PFD_TYPE_RGBA,1)
	glShadeModel(GL_SMOOTH)
	glClearColor(0.0, 0.0, 0.0, 0.5)
	glClearDepth(1.0)
	glEnable(GL_DEPTH_TEST)
	glDepthFunc(GL_LEQUAL)
	glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST)
	glDisable(GL_DITHER)
	if setIdle(True) then end if
end procedure
setHandler( win, w32HOpen, routine_id("win_onOpen"))

--window is open, set up remaining environment vars
procedure win_onActivate(integer self, integer event, sequence params)
sequence rect
integer width, height
    rect = getClientRect(win)
    width = rect[3]-rect[1]
    height=rect[4]-rect[2]

	glViewport(0,0,width,height)

	glMatrixMode(GL_PROJECTION)	-- Select The Projection Matrix
	glLoadIdentity()            -- Reset The Projection Matrix
        gluPerspective(45.0,width/height,0.1,100.0)

	glMatrixMode(GL_MODELVIEW)	-- Select The Modelview Matrix
    glLoadIdentity()            -- Reset The Modelview Matrix
    display()
end procedure
setHandler( win, w32HActivate, routine_id("win_onActivate"))

procedure do_display(integer self, integer event, sequence params)
	display()
end procedure
setHandler(win,{w32HPaint,w32HIdle},routine_id("do_display"))

WinMain( win,Maximize )


-=ck
"Programming in a state of EUPHORIA."
http://www.cklester.com/euphoria/

new topic     » goto parent     » topic index » view message » categorize

15. Re: Win32Lib + OpenGL = Love

Brilliant!

new topic     » goto parent     » topic index » view message » categorize

16. Re: Win32Lib + OpenGL = Love

> > one white *tri*angle

>-- draw our *quad*rangle

Hmm...


How about

glBegin(GL_TRIANGLES)
  glVertex2f(0, 1)
  glVertex2f(-1, -1)
  glVertex2f(1, -1)
glEnd()

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu