Please login or register.

Login with username, password and session length
Pages: 1 2 [3] 4 5 ... 10
 on: March 08, 2018, 08:18:04 
Started by Misterpin - Last post by spasi
Yes, you first initialize GLFW with glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API), then initialize bfgx which creates the context. You get the context handle with bgfx_get_internal_data(), then you can do the custom rendering. Fair warning: it's more than likely that you'll have to study bgfx internals if you want to render to the same context as bgfx, without messing its state. Creating a new context with object sharing should be simpler. Depends on what exactly you're trying to do of course.

 on: March 08, 2018, 08:04:30 
Started by Misterpin - Last post by Misterpin
That is, you can initialize bgfx and render?

 on: March 07, 2018, 20:01:19 
Started by Misterpin - Last post by spasi
It should be possible. There's the bgfx_get_internal_data() function that returns this structure:

Code: [Select]
struct bgfx_internal_data_t {
    bgfx_caps_t * caps;
    void * context;

If you initialized bgfx with the OpenGL renderer (BGFX_RENDERER_TYPE_OPENGL), then the context pointer is the OpenGL context handle. You can grab it and, for example, create another OpenGL context that shares objects with the bgfx context (you'll need the platform-specific WGL/GLX/GLX bindings for that).

Note: I just noticed that there's a bug in the bindings and the context pointer is not exposed in the BGFXInternalData class. A workaround for now:

Code: [Select]
BGFXInternalData id = bgfx_get_internal_data();
long ctx = memGetAddress(id.address() + POINTER_SIZE);

 on: March 07, 2018, 19:44:31 
Started by Misterpin - Last post by Misterpin
I using GLFW for window and input.

 on: March 07, 2018, 19:42:08 
Started by Misterpin - Last post by Misterpin
Good afternoon! Let's say I have a game that uses OpenGL. But can I use bgfx and opengl at the same time for rendering or not?
For example: I draw a cube on opengl, and another 3D figure using bgfx?

 on: March 07, 2018, 19:39:07 
Started by Misterpin - Last post by Misterpin
Thank you!

 on: March 07, 2018, 19:07:34 
Started by Misterpin - Last post by spasi
Yes, you can. This is the latest commit that adds a new binding. It should give you a feel of how much work is needed and which files must change in LWJGL.

Some kinds of bindings are more difficult than others, and may require more elaborate setup. My advice is: find an existing binding that is similar to the one you want to add, copy its structure and slowly adjust it to the new binding, while monitoring the generated output. It will give you a good feel of what changes in the Kotlin templates produce what C/Java output.

Finally, I'm always available on slack if you need help with anything.

 on: March 07, 2018, 18:23:20 
Started by Misterpin - Last post by Misterpin
Hello! Can I make bindings in lwjgl myself?
Thank you!

 on: March 07, 2018, 07:47:49 
Started by mrdlink - Last post by mrdlink
I feel stupid now. That wasn't the actual tutorial I meant XD. But now that I took a closer look, it makes a whole lot of sense.

 on: March 06, 2018, 22:43:06 
Started by mrdlink - Last post by KaiHH
Ok, I bound a seperate buffer for the output vertices. I did get an error INVALID_OPERATION for the first glDrawArrays. Now everything is processed. But can't you define a single VBO as an input and output buffer for transform feedback. Or do you just copy the the feedback buffer into the VBO for drawing?
I mean, isn't this transform feedback could be used for? Updating VBOs just on the GPU through shaders?
For example, if you wanted to make a particle system that is just updated on the GPU with millions of paticles; copying all that data for every transformation is very expensive. Why not just write it into the same same VBO then?
If you had actually read that tutorial you were supposedly following, you would have realized that this is exactly what they are doing there. They ping-pong between two buffer objects, one time used for sourcing vertex attributes for a draw call (i.e. VBO) and another time as transform feedback target. No copying involved. Just a reassignment of the role of each buffer object.

Pages: 1 2 [3] 4 5 ... 10