Quantcast

SP-Forth and OpenGL question

classic Classic list List threaded Threaded
28 messages Options
12
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

SP-Forth and OpenGL question

D TALIAFERRO
Hello, I am a new subscriber.

About ten years ago I wrote a Forth-OpenGL binding using pForth and now want to do some more work with that.

I could not find detailed information on OpenGL in SP-Forth but it looks like there is some OpenGL stuff in there.

Can someone point me to information on this so I can get started?

Thanks,

Dave T

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Spf-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spf-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SP-Forth and OpenGL question

Andrey Cherezov
Hello, D TALIAFERRO!

07.11.2008 18:01 you wrote:
> About ten years ago I wrote a Forth-OpenGL binding using pForth and
> now want to do some more work with that.
>
> I could not find detailed information on OpenGL in SP-Forth but it
> looks like there is some OpenGL stuff in there.
>
> Can someone point me to information on this so I can get started?
Start from demo:
~ygrek/prog/wfl/bunny.f
~ygrek/prog/joopengl/joopengl.f
http:///www.forth.org.ru/~ac/test/opengl_glut.zip


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Spf-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spf-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SP-Forth and OpenGL question

ygrek-3
In reply to this post by D TALIAFERRO
On Fri, 7 Nov 2008 16:01:12 +0000
D TALIAFERRO <[hidden email]> wrote:

>
> Hello, I am a new subscriber.
>
> About ten years ago I wrote a Forth-OpenGL binding using pForth and now want to do some more work with that.
>
> I could not find detailed information on OpenGL in SP-Forth but it looks like there is some OpenGL stuff in there.
>
> Can someone point me to information on this so I can get started?

Some efforts are listed here : http://spf.sourceforge.net/docs/devel.en.html#graphics
Those wrappers basically create window and let you directly call opengl api to draw something.
There is also "canvas" concept prototype which is suitable for simple scenes.

--
 ~ygrek

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Spf-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spf-dev

attachment0 (204 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SP-Forth and OpenGL question

D TALIAFERRO
I was able to run the demos, looks promising.
 
pForth was written in C. http://www.softsynth.com/pforth/
 
Another C Forth is FICL : http://ficl.sourceforge.net/
 
My pForth-OpenGL hacked the GLUT dll to enable an interactive console to the OpenGL calls. I have since lost the code for that.
 
What is language is the SP-Forth nucleus written in? I don't really need the nucleus code but do need means to call C functions, which it appears SP-Forth can do.


> Date: Fri, 7 Nov 2008 23:48:33 +0200
> From: [hidden email]
> To: [hidden email]
> Subject: Re: [Spf-dev] SP-Forth and OpenGL question
>
> On Fri, 7 Nov 2008 16:01:12 +0000
> D TALIAFERRO <[hidden email]> wrote:
>
> >
> > Hello, I am a new subscriber.
> >
> > About ten years ago I wrote a Forth-OpenGL binding using pForth and now want to do some more work with that.
> >
> > I could not find detailed information on OpenGL in SP-Forth but it looks like there is some OpenGL stuff in there.
> >
> > Can someone point me to information on this so I can get started?
>
> Some efforts are listed here : http://spf.sourceforge.net/docs/devel.en.html#graphics
> Those wrappers basically create window and let you directly call opengl api to draw something.
> There is also "canvas" concept prototype which is suitable for simple scenes.
>
> --
> ~ygrek


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Spf-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spf-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SP-Forth and OpenGL question

Andrey Cherezov
08.11.2008 0:59:
My pForth-OpenGL hacked the GLUT dll to enable an interactive console to the OpenGL calls. I have since lost the code for that.
 
What is language is the SP-Forth nucleus written in? I don't really need the nucleus code but do need means to call C functions, which it appears SP-Forth can do.
SP-Forth is written in SP-Forth (source code is available in the src/ folder).
Samples of calling C-funtions from SP-Forth you can see in opengl_glut.zip (same GLUT.dll, as you hacked in past). Keyword - "WINAPI:"

> http:///www.forth.org.ru/~ac/test/opengl_glut.zip

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Spf-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spf-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SP-Forth and OpenGL question

D TALIAFERRO

>SP-Forth is written in SP-Forth

 

I knew someone would say that.

 

Ok, I was able to get the glut demo running. Looks like I will need to modify the glut32.dll to have the SP-Forth console available when I am running OpenGL code.

 

The (KEY-WND-PROC) causes Sp-Forth to stop working (Windows Vista).

 

Anyway the glut.f stuff looks familiar. I am looking over my pForth code which implements an L-system interpreter to try to remember how I did it.

 

Thanks.

 

 

 

-----Original Message-----
From: Andrey Cherezov [mailto:[hidden email]]
Sent: Friday, November 07, 2008 4:35 PM
To: SPF developers
Subject: Re: [Spf-dev] SP-Forth and OpenGL question

 

08.11.2008 0:59:

My pForth-OpenGL hacked the GLUT dll to enable an interactive console to the OpenGL calls. I have since lost the code for that.
 
What is language is the SP-Forth nucleus written in? I don't really need the nucleus code but do need means to call C functions, which it appears SP-Forth can do.

SP-Forth is written in SP-Forth (source code is available in the src/ folder).
Samples of calling C-funtions from SP-Forth you can see in opengl_glut.zip (same GLUT.dll, as you hacked in past). Keyword - "WINAPI:"

> http:///www.forth.org.ru/~ac/test/opengl_glut.zip


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Spf-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spf-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SP-Forth and OpenGL question

Andrey Cherezov
In reply to this post by D TALIAFERRO
David 08.11.2008 3:21:

Ok, I was able to get the glut demo running. Looks like I will need to modify the glut32.dll to have the SP-Forth console available when I am running OpenGL code.

No :)
Replace
' TEST TO <MAIN> S" glut-test.exe" SAVE
with the following code:
' TEST TASK: TEST-TASK
0 TEST-TASK START DROP
and you'll be able to run glut demo (its glutMainLoop) in separate thread
and keep Forth console as the main thread.

The (KEY-WND-PROC) causes Sp-Forth to stop working (Windows Vista).

Not need to run it manually. glutMainLoop calls keyboard handler function, assigned by glutKeyboardFunc - that is our (KEY-WND-PROC) -
and allows us to rotate and zoom the model.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Spf-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spf-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SP-Forth and OpenGL question

D TALIAFERRO

>and you'll be able to run glut demo (its glutMainLoop) in separate thread
>and keep
Forth console as the main thread.

That is nice. I may be able to port my l-system code to sp-forth now.

 

In my text editor there are a lot of special characters such as

 

Iâëåâî  that is, hex E2 EB E5 E2 EE

 

SP-Forth does not have errors with these characters; what do they mean?

 

 

 

 


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Spf-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spf-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SP-Forth and OpenGL question

Ruvim Pinka
In reply to this post by Andrey Cherezov
Hello!

On 11/8/08, David Taliaferro <[hidden email]> wrote:
>
> In my text editor there are a lot of special characters such as
>
> Iâëåâî  that is, hex E2 EB E5 E2 EE
>
> SP-Forth does not have errors with these characters; what do they mean?

It is a Russion text in the Windows-1251 charset.

You have to select a right encoding in your text editor or choose the
Russion language for non-Unicode programs (Control Panel, Regional
options).

Not any text editor supports the encoding selection, but the KomodoEdit does.

--
Ruvim
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Spf-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spf-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SP-Forth and OpenGL question

Ruvim Pinka
On 11/9/08, Ruvim Pinka <[hidden email]> wrote:
> It is a Russion text
ай-ай-яй :)  Russian.

--
Ruvim
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Spf-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spf-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SP-Forth and OpenGL question

Andrey Cherezov
In reply to this post by D TALIAFERRO
David Taliaferro wrote 08.11.2008 20:46:

That is nice. I may be able to port my l-system code to sp-forth now.

 

In my text editor there are a lot of special characters such as

 

Iâëåâî  that is, hex E2 EB E5 E2 EE

 

SP-Forth does not have errors with these characters; what do they mean?

Russian for "to left". This is just comment, not SP-Forth command.

...
DUP 100 = IF ( left ) RO DF@ 2e F+ RO DF! THEN
DUP 101 = IF ( up ) RO2 DF@ 2e F- RO2 DF! THEN
DUP 102 = IF ( right ) RO DF@ 2e F- RO DF!  THEN
DUP 103 = IF ( down ) RO2 DF@ 2e F+ RO2 DF! THEN
...


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Spf-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spf-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SP-Forth and OpenGL question

Andrey Cherezov
In reply to this post by Ruvim Pinka
Добрый день, Ruvim Pinka & Spf-dev!

Ваше сообщение от 09.11.2008 0:26:
On 11/9/08, Ruvim Pinka [hidden email] wrote:
  
It is a Russion text
    
ай-ай-яй :)  Russian.
  
Да, оплошал :( Ну, главное, по-русски ошибок стараться не делать.
По-английски я в любом случае безграмотно пишу :)

А опечатка интересная получилась. Сейчас некоторые отказываются наше
современное государство называть Россией, а используют вместо этого
Россияния или Россиюния (потому что в ней живут не русские, а россияне).
У меня получилось искажение в том же стиле по-английски, но случайно ;)

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Spf-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spf-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SP-Forth and OpenGL question

Andrey Cherezov
In reply to this post by Ruvim Pinka
Ваше сообщение от 09.11.2008 0:26:
On 11/9/08, Ruvim Pinka [hidden email] wrote:
  
It is a Russion text
    
ай-ай-яй :)  Russian.
  
А, так это не я? Ну ладно, я тоже так могу :)



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Spf-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spf-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SP-Forth and OpenGL question

Ruvim Pinka
2008/11/9 Andrey Cherezov <[hidden email]>
Ваше сообщение от 09.11.2008 0:26:
On 11/9/08, Ruvim Pinka [hidden email] wrote:
  
It is a Russion text
    
ай-ай-яй :)  Russian.
  
А, так это не я? Ну ладно, я тоже так могу :)

Рассмешил :))   — даже не так совестно стало ;)
Да, это я, и на себя же посетовал.

--
Ruvim

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Spf-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spf-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SP-Forth and OpenGL question

D TALIAFERRO
In reply to this post by Andrey Cherezov
How do I link C objects to SP-Forth?

I tried using a dll :

WINAPI:    lparser    fptest.dll

where lparser is a DWORD function in the fptest.dll


In SP-Forth I get this error :

WINAPI: lparser fptest.dll
                        ^ -2010 Procedure not found


My code does not use Windows; I can also compile a straight C object if that works.

Thanks

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Spf-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spf-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SP-Forth and OpenGL question

Ruvim Pinka
On Tue, Nov 11, 2008 at 7:08 PM, D TALIAFERRO <[hidden email]> wrote:

WINAPI: lparser fptest.dll
                        ^ -2010 Procedure not found

Please, provide an output of the
  pedump fptest.dll | grep -i lparser

--
Ruvim

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Spf-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spf-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SP-Forth and OpenGL question

D TALIAFERRO
Ruvim,

lparser (or any other functions) does not appear in pedump output.

I just compiled a generic C program to see how to import into SP-Forth. I changed the void main() definition to :

DWORD
lparser(int argc, char *argv[])

Do I need to do something (export) in the C-code to make the dll or object functions available to an external program?

Thanks,

Dave





Date: Tue, 11 Nov 2008 19:28:51 +0300
From: [hidden email]
To: [hidden email]
Subject: Re: [Spf-dev] SP-Forth and OpenGL question

On Tue, Nov 11, 2008 at 7:08 PM, D TALIAFERRO <[hidden email]> wrote:

WINAPI: lparser fptest.dll
                        ^ -2010 Procedure not found

Please, provide an output of the
  pedump fptest.dll | grep -i lparser

--
Ruvim

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Spf-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spf-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SP-Forth and OpenGL question

Dave Taliaferro
In reply to this post by Ruvim Pinka
I just found this export viewer, a little nicer than pedump :

http://www.nirsoft.net/utils/dll_export_viewer.html



Date: Tue, 11 Nov 2008 19:28:51 +0300
From: [hidden email]
To: [hidden email]
Subject: Re: [Spf-dev] SP-Forth and OpenGL question

On Tue, Nov 11, 2008 at 7:08 PM, D TALIAFERRO <[hidden email]> wrote:

WINAPI: lparser fptest.dll
                        ^ -2010 Procedure not found

Please, provide an output of the
  pedump fptest.dll | grep -i lparser

--
Ruvim

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Spf-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spf-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SP-Forth and OpenGL question

Ruvim Pinka
In reply to this post by D TALIAFERRO
On Tue, Nov 11, 2008 at 7:50 PM, D TALIAFERRO <[hidden email]> wrote:

I just compiled a generic C program to see how to import into SP-Forth. I changed the void main() definition to :

DWORD
lparser(int argc, char *argv[])

Do I need to do something (export) in the C-code to make the dll or object functions available to an external program?

Yes, You need it.
Making a dll from C sources does not relate to SP-Forth :)

For example, look at this totorial: http://www.flipcode.com/archives/Creating_And_Using_DLLs.shtml
Please, use the "PAS" declaration instead of "C".

--
Ruvim

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Spf-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spf-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SP-Forth and OpenGL question

D TALIAFERRO
Ruvim,

I tried the example from the link you provided, also generic Visual Studio dll example.

Can't see exported functions, or when I can see them, the names are mangled, so it's a compiler issue right now.

I am using Visual Studio C++ Express (free edition).

Assuming I get that to work (correct dll export) with my C compiler, in SP-Forth, do I need to use the WINAPI LoadLibrary function to bring it into SP-Forth?

Also VStudio does not recognize "PAS" directive.

Thanks



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Spf-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spf-dev
12
Loading...