Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (683)
Games in Android Showcase (196)
games submitted by our members
Games in WIP (751)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1] 2 3 ... 20
1  Discussions / General Discussions / Re: Razer OSVR HDK on: 2016-03-29 21:18:11
this thing is designed so that one can swap out the screen and other hardware. I'll try and see what the options are for the screen.
2  Discussions / General Discussions / Razer OSVR HDK on: 2016-03-29 00:20:03
I'm surprised I haven't seen more about this on the game forums. It doesn't have the resolution of the rift but is much cheaper. opinions?

http://www.razerzone.com/osvr-hacker-dev-kit
3  Discussions / Community & Volunteer Projects / Re: looking for developers for porting project for IK lib on: 2016-01-26 18:44:54
sorry. It's a JNI wrapper around c++. I'm trying to port to purely java.
4  Discussions / Community & Volunteer Projects / looking for developers for porting project for IK lib on: 2016-01-25 22:13:04
would anybody be interested in helping me port this wrapper
http://digilander.libero.it/carmine.lia/jroboop/
into pure java?
I am particularly interested in the inverse kinematics parts.
5  Java Game APIs & Engines / OpenGL Development / Re: Vulkan delayed to "early 2016" Q___Q on: 2016-01-08 22:21:13
and of course less confusion over what the fast path is
6  Discussions / General Discussions / Re: Cross platform GUI frameworks with an OpenGL canvas on: 2015-11-15 00:44:27
I have some code i'm using in my own engine that can embed javafx in an opengl texture, if you're interested
7  Game Development / Game Play & Game Design / Re: Anti Aimbot?? on: 2015-11-04 04:08:29
you could check and see if the player's constantly aiming through the exact same spot on the other player.
8  Java Game APIs & Engines / OpenGL Development / Re: Global Illumination via Voxel Cone Tracing in LWJGL on: 2015-10-19 16:51:29
Mind uploading you program to shared code or JGO files?
9  Discussions / Miscellaneous Topics / Re: Low spec pc linux puppy for old school games... on: 2015-10-15 17:38:43
I've run emulators with on a machine with similar memory and processor under puppy.
10  Game Development / Shared Code / Re: embedding javaFX inside opengl on: 2015-09-07 02:59:01
never mind. got it working

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
  int AlphaBlend( int bg,  int src)
   {
       
       int bA=src&0xff;
       int gA=(src>>8)&0xff;
       int rA=(src>>16)&0xff;
       int aA=(src>>24)&0xff;
       
       int bB=bg&0xff;
       int gB=(bg>>8)&0xff;
       int rB=(bg>>16)&0xff;
       int aB=(bg>>24)&0xff;
       
       
       int rOut = (rA * aA / 255) + (rB * aB * (255 - aA) / (255*255));
             int gOut = (gA * aA / 255) + (gB * aB * (255 - aA) / (255*255));
             int bOut = (bA * aA / 255) + (bB * aB * (255 - aA) / (255*255));
             int aOut = aA + (aB * (255 - aA) / 255);
             
             
             return (aOut<<24)|(rOut<<16)|(gOut<<8)|(bOut);
   }


I've updated the pastebin code for cursor support.
11  Game Development / Shared Code / Re: embedding javaFX inside opengl on: 2015-09-06 23:38:55
i need a bit of help with the compositing.
This is what I'm using now.

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  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
71  
72  
73  
74  
75  
76  
77  
78  
79  
80  
81  
82  
83  
84  
85  
86  
87  
88  
89  
90  
91  
92  
93  
public boolean getPixels(IntBuffer dest, int width, int height)
    {
       if(scenePeer!=null)
       {
        boolean success=scenePeer.getPixels(dest, width, height);
       
       
       
       if(success)
       {
         
       
          if(drawcursor&&currentframe!=null)
          {
         
             cursorlock.lock();
             System.out.println("draw cursor");
             //NOTE composite the cursor
             
          com.sun.prism.Image img =(com.sun.prism.Image) currentframe.getPlatformImage();
       
             
             
             for(int x=0;x<currentframe.getWidth();x++)
             {
                for(int y=0;y<currentframe.getHeight();y++)
                {
                   
                   int framex=(int) (mousex-currentframe.getHotspotX()+x);
                   int framey=(int) (mousey-currentframe.getHotspotY()+y);
                   
                   
                   if(framex>=0&&framex<=width&&framey>=0&&framey<=height)
                   {
                     
                      int index=framex+(framey*width);
                     
                      int destcolor=dest.get(index);
                     
                      int destb=destcolor&0xff;
                      int destg=(destcolor>>8)&0xff;
                      int destr= (destcolor>>16)&0xff;
                      int desta=(destcolor>>24)&0xff;
                     
                     
                      int srccolor=img.getArgb(x, y);
                     
                      int srcb=srccolor&0xff;
                      int srcg=(srccolor>>8)&0xff;
                      int srcr= (srccolor>>16)&0xff;
                      int srca=(srccolor>>24)&0xff;
                     
                     
                     
                      int enda=srca+desta*(1-srca);
                     
                      int endr=0,endb=0,endg=0;
                     
                     
                      System.out.println(enda);
                      if(enda!=0)
                      {
                       endb=(srcb*srca+destb*desta*(1-srca))/enda;
                       endg=(srcg*srca+destg*desta*(1-srca))/enda;
                       endr=(srcr*srca+destr*desta*(1-srca))/enda;
                      }
                     
                      int endcolor=0;
                      endcolor|= endb;
                      endcolor|= endg<<8;
                      endcolor|=endr<<16;
                      endcolor|=enda<<24;
                      dest.put(index, endcolor);
                     
                     
                   }
                   
                   
                }

             }
             cursorlock.unlock();
             
             
         
          }
         
          return true;
       }

       }
       return false;
    }


It's getting some strange results. for some odd reason it puts the cursor over the text field but under the button. if i switch the source and destination, it renders under the text field but over the button. why?


12  Discussions / General Discussions / small 120hz display? on: 2015-08-18 21:50:08
Just wondering if anyone's seen a 120hz display around 17inch size.I've been looking around, and the smallest I've been able to find is 24inch, which is too large for me considering the space on my desk.
13  Game Development / Shared Code / Re: embedding javaFX inside opengl on: 2015-07-22 20:02:10
texture's going to be UV mapped. I could just use java to composite the cursor on top before i update the texture. Or maybe do it inside my shader.
14  Game Development / Shared Code / Re: embedding javaFX inside opengl on: 2015-07-22 19:31:35
that works for GLFW, but i want the capability so i can do those in-game terminals like in doom3.
15  Game Development / Shared Code / Re: embedding javaFX inside opengl on: 2015-07-22 19:02:12
any ideas how i could draw a cursor in the texture for if the window hides the system cursor or if i'm doing an in-game screen like in doom3?
16  Discussions / General Discussions / Re: Steam Machine vs homebuilt PC on: 2015-07-02 14:11:52
I was just wondering if they were trying to subsidize or sell at a loss like consoles do.
17  Game Development / Shared Code / Re: embedding javaFX inside opengl on: 2015-07-01 20:26:54
How are you getting mouse and keyboard events into javafx?
18  Discussions / General Discussions / Re: What projects are you guys working on? How's progress going? on: 2015-07-01 20:16:52
3d engine in java. I've mostly finished making some classes to embed Javafx in openGL for the GUI

Pretty please can you open source it once you have a working product? Even something really rudimentary, the people need a good GUI backend for OpenGL.

I've put it in Shared code

http://www.java-gaming.org/topics/embedding-javafx-inside-opengl/36349/view.html
19  Discussions / General Discussions / Steam Machine vs homebuilt PC on: 2015-07-01 20:01:13
How do steam machines compare to PCs for price vs performance? I'm trying to decide whether i should build my own desktop or get a steam machine and install linux on it.
20  Game Development / Shared Code / Re: embedding javaFX inside opengl on: 2015-07-01 19:59:44
JavaFX has components for embedding itself into Swing and SWT. What i'm doing is loading the image into a ByteBuffer and then using that to update a texture (you could subclass texupdater and use a PBO with a mapped bytebuffer too). then in my demo, I'm using GLFW to get input from the mouse and keyboard to feed to Javafx.
21  Discussions / Miscellaneous Topics / Re: What's your favorite OS and why? on: 2015-06-30 21:11:34
running Linux Mint right now
22  Discussions / General Discussions / Re: What projects are you guys working on? How's progress going? on: 2015-06-30 21:08:33
3d engine in java. I've mostly finished making some classes to embed Javafx in openGL for the GUI
23  Game Development / Shared Code / embedding javaFX inside opengl on: 2015-06-30 15:40:02
this code allows you to use Javafx as your GUI in OpenGL. Includes an example using LWJGL3 and GLFW

http://pastebin.java-gaming.org/e0c5c939d2a19
http://pastebin.java-gaming.org/a067532503d19
http://pastebin.java-gaming.org/c5c3d1a093f15
24  Discussions / Miscellaneous Topics / Re: What is your opinion about ... on: 2015-06-01 16:47:10
I usually just use printlns for exceptions. for incorrect results i sometimes use breakpoints because printlns would fill the console up too fast
25  Game Development / Networking & Multiplayer / Re: Netcode works perfectly on one network, doesn't work on another. on: 2015-05-31 17:51:16
it could be all sorts of things. are you entering IP addresses manually, or using some form of discovery?
26  Discussions / Miscellaneous Topics / Re: What are your current personal projects? on: 2015-05-25 19:28:06
Game engine in java. right now i'm trying to integrate JavaFX with opengl.
27  Java Game APIs & Engines / OpenGL Development / Re: texture problems on: 2015-05-22 19:58:32
Thanks, that worked.
28  Java Game APIs & Engines / OpenGL Development / texture problems on: 2015-05-22 18:47:23
I am using the following java code

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  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
71  
72  
73  
74  
75  
76  
77  
78  
79  
80  
81  
82  
83  
84  
85  
86  
87  
88  
89  
90  
91  
92  
93  
94  
95  
96  
97  
98  
99  
100  
101  
102  
103  
104  
105  
106  
107  
108  
109  
110  
111  
112  
113  
114  
115  
116  
117  
118  
119  
120  
121  
122  
123  
124  
125  
126  
127  
128  
129  
130  
131  
132  
133  
134  
135  
136  
137  
138  
139  
140  
141  
142  
143  
144  
145  
146  
147  
148  
149  
150  
151  
152  
153  
154  
155  
156  
157  
158  
159  
160  
161  
162  
163  
164  
165  
166  
167  
168  
169  
170  
171  
172  
173  
174  
175  
176  
177  
178  
179  
180  
181  
182  
183  
184  
185  
186  
187  
188  
189  
190  
191  
192  
193  
194  
195  
196  
197  
198  
199  
200  
201  
202  
203  
204  
205  
206  
207  
208  
209  
210  
211  
212  
213  
214  
215  
216  
217  
218  
219  
220  
221  
222  
223  
224  
225  
226  
227  
228  
229  
230  
231  
232  
233  
234  
235  
236  
237  
238  
239  
240  
241  
242  
243  
244  
245  
246  
247  
248  
249  
250  
251  
252  
253  
254  
255  
256  
257  
258  
259  
260  
261  
262  
263  
264  
265  
266  
267  
268  
269  
270  
271  
272  
273  
274  
275  
276  
277  
278  
279  
280  
281  
282  
283  
284  
285  
286  
287  
288  
289  
290  
package SPAGE.engine.gui;

import java.io.File;
import java.io.FileNotFoundException;
import java.nio.ByteBuffer;
import java.nio.FloatBuffer;
import java.nio.IntBuffer;
import java.util.Random;
import java.util.Scanner;

import javafx.application.Platform;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.paint.Color;
import javafx.scene.text.Font;
import javafx.scene.text.Text;

import org.lwjgl.BufferUtils;
import org.lwjgl.glfw.Callbacks;
import org.lwjgl.glfw.GLFWErrorCallback;
import org.lwjgl.glfw.GLFWKeyCallback;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL13;
import org.lwjgl.opengl.GL20;
import org.lwjgl.opengl.GLContext;

import static org.lwjgl.glfw.GLFW.*;
import static org.lwjgl.opengl.GL11.*;
import static org.lwjgl.opengl.GL15.*;
import static org.lwjgl.opengl.GL20.*;
import static org.lwjgl.opengl.GL30.*;
import static org.lwjgl.opengl.GL31.*;
import static org.lwjgl.opengl.GL32.*;
import static org.lwjgl.opengl.GL33.*;
import static org.lwjgl.system.MemoryUtil.*;


public class glembedtest {
   
   private GLFWErrorCallback errorCallback = Callbacks.errorCallbackPrint(System.err);
   
   long window;
   
   private GLFWKeyCallback keyCallback = new GLFWKeyCallback() {
       @Override
       public void invoke(long window, int key, int scancode, int action, int mods) {
           if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS) {
               glfwSetWindowShouldClose(window, GL_TRUE);
           }
       }
   };
   
   glStagePlatform plat = new glStagePlatform();
   
   int vbo;
   int tcb;
   int tex;
   int program;
   
   public void go()
   {
      glfwSetErrorCallback(errorCallback);
     
      if (glfwInit() != GL_TRUE) {
          throw new IllegalStateException("Unable to initialize GLFW");
      }
     
     
      glfwDefaultWindowHints();
      glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
      glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
      glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
      glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
     
       window = glfwCreateWindow(640, 480, "Simple example", NULL, NULL);
      if (window == NULL) {
          glfwTerminate();
          throw new RuntimeException("Failed to create the GLFW window");
      }
     
      glfwSetKeyCallback(window, keyCallback);
     
      glfwMakeContextCurrent(window);
      GLContext.createFromCurrent();
     
      /*
        Platform.runLater(new Runnable() {
            @Override
            public void run() {
           plat.setScene(createScene());
            }
       });
   
   plat.setsize(512, 512);
   */

   
   
   
   
   
   ByteBuffer buf= ByteBuffer.allocateDirect(512*512*3);
   Random r = new Random();
   for(int x=0;x<buf.capacity();x++)
   {
      buf.put((byte) r.nextInt(255));
     
   }
   
   buf.flip();
   
   
   
   tex=glGenTextures();
   glBindTexture(GL_TEXTURE_2D, tex);
   
   GL11.glTexImage2D(GL_TEXTURE_2D,0,GL_RGB,512,512,0,GL_RGB,GL_UNSIGNED_BYTE,buf);

   
   int vao = glGenVertexArrays();
   glBindVertexArray(vao);
   
   //set up vbo
   
   float[] vbodata = {
         -0.9f, -0.9f, 0.0f,
         0.9f, -0.9f, 0.0f,
         -0.9f, 0.9f,0.0f,
         0.9f,  0.9f, 0.0f,
         
      };
   
   FloatBuffer fb= BufferUtils.createFloatBuffer(vbodata.length);
   fb.put(vbodata);
   fb.flip();
   
   vbo=glGenBuffers();
   
   glBindBuffer(GL_ARRAY_BUFFER,vbo);
   
    glBufferData(GL_ARRAY_BUFFER,fb,  GL_STATIC_DRAW);
   
    float[] tcs={0f,0f,
                    0f,1f,
                    1f,1f,
                    1f,0f};
   
    fb= BufferUtils.createFloatBuffer(tcs.length);
      fb.put(tcs);
      fb.flip();
   
      tcb=glGenBuffers();
     
      glBindBuffer(GL_ARRAY_BUFFER,tcb);
     
       glBufferData(GL_ARRAY_BUFFER,fb,  GL_STATIC_DRAW);
     
     
   
    program=createshaders("shaders/shader.vtex","shaders/shader.frag");
       
    glClearColor(0.0f, 0.0f, 0.4f, 0.0f);
     
      while (glfwWindowShouldClose(window) != GL_TRUE)
      {
       mainloop();
      }
     
      glfwDestroyWindow(window);
      keyCallback.release();
      glfwTerminate();
      errorCallback.release();
     
   }
   
   public static void main(String[] args)
   {
      new glembedtest().go();
     
   }

   
   public void mainloop()
   {
      glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
      glUseProgram(program);
     
      glEnableVertexAttribArray(0);
      glEnableVertexAttribArray(1);
      glBindBuffer(GL_ARRAY_BUFFER, vbo);
      GL20.glVertexAttribPointer(0, 3, GL_FLOAT, false, 0, 0);
     
      glBindBuffer(GL_ARRAY_BUFFER, tcb);
      GL20.glVertexAttribPointer(1, 2, GL_FLOAT, false, 0, 0);
     
     
      GL13.glActiveTexture(GL13.GL_TEXTURE0);
      int texloc=glGetUniformLocation(program, "mytex");
      glUniform1i(texloc, 0);
      glBindTexture(GL_TEXTURE_2D, tex);
     
     
     
      glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
     


      glfwSwapBuffers(window);
      glfwPollEvents();
   }
   
   
   
    private static Scene createScene() {
        Group  root  =  new  Group();
        Scene  scene  =  new  Scene(root, Color.BLUE);
        Text  text  =  new  Text();
       
        text.setX(40);
        text.setY(100);
        text.setFont(new Font(25));
        text.setText("Welcome JavaFX!");

        root.getChildren().add(text);

        return (scene);
    }
   
   
   
    int createshaders(String vert, String frag)
    {
       int VertexShaderID = glCreateShader(GL_VERTEX_SHADER);
        int FragmentShaderID = glCreateShader(GL_FRAGMENT_SHADER);
       
        String code="";
        try {
         Scanner scan = new Scanner(new File(vert));
         
         while(scan.hasNext())
         {
            code+=scan.nextLine()+"\n";
         }
         scan.close();
         
      glShaderSource(VertexShaderID,code);
      glCompileShader(VertexShaderID);

      int result=glGetShaderi(VertexShaderID, GL_COMPILE_STATUS);
      String log=glGetShaderInfoLog(VertexShaderID);
      System.out.println("vtx shader returned: "+log);
     
     
       scan = new Scanner(new File(frag));
     
       code="";
      while(scan.hasNext())
      {
         code+=scan.nextLine()+"\n";
      }
      scan.close();
     
   glShaderSource(FragmentShaderID,code);
   glCompileShader(FragmentShaderID);

    result=glGetShaderi(FragmentShaderID, GL_COMPILE_STATUS);
    log=glGetShaderInfoLog(FragmentShaderID);
   System.out.println("frag shader returned: "+log);
     
     
   int ProgramID = glCreateProgram();
    glAttachShader(ProgramID, VertexShaderID);
    glAttachShader(ProgramID, FragmentShaderID);
    glLinkProgram(ProgramID);
   
    result=glGetProgrami(ProgramID, GL_LINK_STATUS);
    log=glGetProgramInfoLog(ProgramID);
    System.out.println("program link returned: "+log);
         
    return ProgramID;
         
      } catch (FileNotFoundException ex) {
         
         ex.printStackTrace();
      }
       
        return -1;
       
    }
   
}


and shaders
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
// vertex shader
#version 330 core
 
// Input vertex data, different for all executions of this shader.
layout(location = 0) in vec3 vertexPosition_modelspace;
layout(location = 1) in vec2 vertexUV;
 
// Output data ; will be interpolated for each fragment.
out vec2 UV;

 
void main(){
 
    // Output position of the vertex, in clip space : MVP * position
    gl_Position = vec4(vertexPosition_modelspace,1);
 
    // UV of the vertex. No special space for this one.
    UV = vertexUV;
}


1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
//fragment shader
#version 330 core
 
// Interpolated values from the vertex shaders
in vec2 UV;
 
// Ouput data
out vec3 color;
 
// Values that stay constant for the whole mesh.

uniform sampler2D mytex;

 
void main(){
 
    // Output color = color of the texture at the specified UV
    color = texture( mytex, UV ).rgb;
 
}


I'm expecting a rectangle with random noise in it (i'm actually trying to make a gui, but i'm just loading noise into my texture to test the shader), but all i get is a black rectangle. any ideas what i'm doing wrong here?
29  Discussions / General Discussions / Re: What's your day job? on: 2015-05-07 14:22:06
just got a job for the summer teaching at a tech summer camp
30  Java Game APIs & Engines / OpenGL Development / javafx render to texture on: 2015-04-25 22:09:01
is there any way get an image from javafx that could be loaded into a texture and feed in events from the engine? I'd like to use it for my menu and possibly a doom3 style GUI.
Pages: [1] 2 3 ... 20
 
orrenravid (210 views)
2016-07-16 03:57:23

theagentd (281 views)
2016-07-11 14:28:54

Hydroque (366 views)
2016-07-06 05:56:57

Hydroque (520 views)
2016-07-03 08:52:54

GrandCastle (393 views)
2016-07-01 09:13:47

GrandCastle (385 views)
2016-07-01 09:09:45

CopyableCougar4 (437 views)
2016-06-25 16:56:52

Hydroque (413 views)
2016-06-22 02:17:53

SwampChicken (379 views)
2016-06-20 13:22:57

SwampChicken (303 views)
2016-06-20 13:22:49
Making a Dynamic Plugin System
by Hydroque
2016-06-25 00:13:25

Java Data structures
by BinaryMonkL
2016-06-13 21:22:09

Java Data structures
by BinaryMonkL
2016-06-13 21:20:42

FPS Camera Tutorial
by Hydroque
2016-05-22 05:40:58

Website offering 3D Models specifically for games for free
by vusman
2016-05-18 17:23:09

Website offering 3D Models specifically for games for free
by vusman
2016-05-09 08:50:56

Website offering 3D Models specifically for games for free
by vusman
2016-05-06 11:10:21

Website offering 3D Models specifically for games for free
by vusman
2016-04-29 12:56:17
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!