Java-Gaming.org Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (800)
Games in Android Showcase (237)
games submitted by our members
Games in WIP (867)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Simplistic yet flexible  (Read 1658 times)
0 Members and 1 Guest are viewing this topic.
Offline lcass
« Posted 2014-09-02 21:40:26 »

I was thinking of developing a very basic language that supports lwjgl. The main idea behind it would be that you can easily create a fairly complex project with very little code , especially for the graphics . So setting up a VBO in lwjgl is a long process require a lot of code with hundreds of different functions that you can use , to create a vbo in this language it could simply be Vbo i = Vbo.create(verticies,texture).  It would also include basic input functions and also direct display handling that allow you to perform tasks such as a tick delay with one line of code. All vbos can be bound to this buffer with Vbo.assign(). and remove with Vbo.remove().  , note that the . is the equivelant of ;. Another feature I was thinking of implementing direct shader writing . So here is an example of what the syntax for it may look like.
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
(Name = "Example")...//Declare new functions and classes through brackets
   Vbo object;
   (init_{})...//parameters are stored within {} and indentation is done through ...
      print{"This is an example"};//end the function call with a ;
      load{};
   ...
   (load{})...
      Display.create{800,600,"Example"};
      Display.starttick{60};
      ?<!object>... //an if statement
            object = Vbo.create{v2d.list{0,0,1,1,1,0,0,1},Texture.load{"Test.png"}};//no creating objects simply function calls that return them
      ...  
      Vbo.assign{object};
      Vbo.translate{object,60,60};
      Vbo.update{object};
      Vbo.createshader{shader-s};//write the shader directly into your code
      Vbo.bindshader{shader-s};//built in error checking confirms wether it has been loaded in
   ...
   (Shader = shader-s)...//very simple shader built directly into the code, this is the default shader that would be used if none were loaded
   attribute vec2 vectex;
   uniform vec2 transform;
   uniform float scalar;
   varying vec2 vecdata;
   void main()
   {
      vec4 offset = vec4(position.x+transform.x,(position.y+transform.y),1,1);
      gl_Position = offset;
      vecdata = vectex;
   }  
   ...
...

That code would gladly render a vbo to the screen with the set texture , what do you think?
Offline BurntPizza

« JGO Bitwise Duke »


Medals: 486
Exp: 7 years



« Reply #1 - Posted 2014-09-02 21:42:02 »

Why a whole language? This is doable as an API.
Offline lcass
« Reply #2 - Posted 2014-09-02 21:47:37 »

Why a whole language? This is doable as an API.
Because creating a language is more difficult than creating an API and it would challenge me. Thats the main reason.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline BurntPizza

« JGO Bitwise Duke »


Medals: 486
Exp: 7 years



« Reply #3 - Posted 2014-09-02 21:49:41 »

I mean sure, if that's the goal, just realize libGDX is pretty much already what you want.

http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/graphics/glutils/VertexBufferObject.html
http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/graphics/glutils/ShaderProgram.html


Not to mention the even higher level abstractions over those such as Meshes, etc.
Offline Riven
Administrator

« JGO Overlord »


Medals: 1371
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #4 - Posted 2014-09-02 22:03:14 »

Using < and > for parameters, makes designing unambiguous syntax for number comparison really difficult...

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings!
Offline saucymeatman
« Reply #5 - Posted 2014-09-02 22:03:32 »

If you think you can do it, and want to, go for it Smiley
It would definitely be an interesting project.

I have some issues with the actual language though, sorry.
I dont want to be cynical, or put down a project that is still in its conceptual stage, but some critisism might make benifit the project.

The language is really verbose, and it is not obvious at all how the dot method/object annotation works.
You shouldnt replace the semi-colon with dots. Its going to make the project less appealing to people that are used to the semi-colon, which is almost everyone.
And if you do replace the semicolon with dots, dont also use the dots to access object members, its really confusing.
The fact that you have to put in a comment the code that was an if-statement should tell you something is wrong with the conditional syntax, sorry.
Offline BurntPizza

« JGO Bitwise Duke »


Medals: 486
Exp: 7 years



« Reply #6 - Posted 2014-09-02 23:10:06 »

Looking at the way you've structured your supposed language, you might like play-clj, a clojure wrapper for libGDX, looks like this:

Create a texture and size + rotate it
1  
2  
3  
(assoc (texture "Clojure-icon.gif")
    :x 50 :y 50 :width 100 :height 100
    :angle 45 :origin-x 0 :origin-y 0)


Handle simply key input:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
:on-key-down
    (fn [screen entities]
        (cond
            (= (:key screen) (key-code :dpad-up))
            (println "up")
            (= (:key screen) (key-code :dpad-down))
            (println "down")
            (= (:key screen) (key-code :dpad-right))
            (println "right")
            (= (:key screen) (key-code :dpad-left))
            (println "left")))


More here and here
Offline lcass
« Reply #7 - Posted 2014-09-03 05:59:03 »

If you think you can do it, and want to, go for it Smiley
It would definitely be an interesting project.

I have some issues with the actual language though, sorry.
I dont want to be cynical, or put down a project that is still in its conceptual stage, but some critisism might make benifit the project.

The language is really verbose, and it is not obvious at all how the dot method/object annotation works.
You shouldnt replace the semi-colon with dots. Its going to make the project less appealing to people that are used to the semi-colon, which is almost everyone.
And if you do replace the semicolon with dots, dont also use the dots to access object members, its really confusing.
The fact that you have to put in a comment the code that was an if-statement should tell you something is wrong with the conditional syntax, sorry.

Yer I can see what you mean however most of that can be handled post designed due to the way im making the compiler , so it runs through each line and it splits up the strings based on the given syntax to give definitions and function blocks which is then all written to the compiled file and run through the javac. Its more of an overlay language than an entirely new language.
I have changed a few things , semicolons are back , and no more alligators for the parameters (if you get this you had a fun maths teacher). I dont know about the ? I like it.
Pages: [1]
  ignore  |  Print  
 
 

 
Riven (348 views)
2019-09-04 15:33:17

hadezbladez (5132 views)
2018-11-16 13:46:03

hadezbladez (2013 views)
2018-11-16 13:41:33

hadezbladez (5400 views)
2018-11-16 13:35:35

hadezbladez (1121 views)
2018-11-16 13:32:03

EgonOlsen (4539 views)
2018-06-10 19:43:48

EgonOlsen (5396 views)
2018-06-10 19:43:44

EgonOlsen (3083 views)
2018-06-10 19:43:20

DesertCoockie (3977 views)
2018-05-13 18:23:11

nelsongames (4527 views)
2018-04-24 18:15:36
A NON-ideal modular configuration for Eclipse with JavaFX
by philfrei
2019-12-19 19:35:12

Java Gaming Resources
by philfrei
2019-05-14 16:15:13

Deployment and Packaging
by philfrei
2019-05-08 15:15:36

Deployment and Packaging
by philfrei
2019-05-08 15:13:34

Deployment and Packaging
by philfrei
2019-02-17 20:25:53

Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!