Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - kramitox

Pages: [1]
1
General / Re: GLES With SFML on Android.
« on: April 06, 2017, 01:52:27 pm »
Got it working today. You were right so thank you so much!
The problem was the Android.mk not having the link in the sfml-system module so when I manually added it it started working :D so thank you again! Now I can finally start making my 3D environment and then moving on to setting up to viewports for the VR experience :)

2
General / Re: Framerate and vertex array
« on: April 06, 2017, 08:52:16 am »
From my experience in openGL, the main memory drainage you would be having is the fact you are using quads instead of triangles. Most graphics cards can draw 2 triangles much faster then they can draw a quad. So try this and hopefully you can get better particles. Your next approach should then be to learn how to use Instancing in openGL.
Instancing pretty much cuts out some of the grunt work. Currently by every draw frame you are sending info to the graphics card for each particle. With instancing you send information about a single particle and then you can use your vertx shaders to manipulate it. Its your best option for rendering particles.

3
General / Re: OpenGl vbo, vertex arrays with sfml
« on: April 05, 2017, 01:49:14 pm »
These are the headers I have had to use in my projects to get anything up and running correctly.

#include <GL/glew.h>
#include <GL/wglew.h>


#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>

#include <SFML/Graphics.hpp>
#include <SFML/OpenGL.hpp>
GLM is a math library I use for creating mat4 variables and doing all my vector rotations, translations, etc.

make sure to also call
glewInit();

4
General / Re: Editing Tiles in a Tilemap
« on: April 05, 2017, 01:38:08 pm »
Okay so from what I am reading is that you are setting up a Map object and inside that there are Quads which you can manipulate.
My approach to this would probably be something along the lines of

for(int i = 0; i < map.quad.size() ; i++
{
  sf::FloatRect a = sf::FloatRect(map.quad.position.x , map.quad.position.y, map.quad.getSize().width, map.quad.getSize().heigth);
  if (player.getGlobalBounds().intersects(a)
  {
      map.quad.position = [insertPositionHere]
      map.quad.texCoords = [insertNewTexCoordsHere]
  }
}

that's one approach that I can think of off the top of my head. I for one wouldn't use Quads and would make my own "Tile" class.

5
General / GLES With SFML on Android.
« on: April 05, 2017, 01:28:08 pm »
Hi guys, I'm working on an assignment for college which is to build a cube in a 3D environment using SFML for an android device.
I managed to get regular SFML stuff working fine following guides on the internet and with lots of headaches (I had no prior experience with Cmake, MinGW, etc.)
Now I am facing a new problem and that is trying to call GL commands in my code.
When I go to compile it, this is the errors I am getting and its only with GL commands.

Quote
[armeabi] Install        : libsfml-activity.so => libs/armeabi/libsfml-activity.so
[armeabi] SharedLibrary  : libsfml-example.so
jni/main.cpp:93: error: undefined reference to 'glMatrixMode'
jni/main.cpp:94: error: undefined reference to 'glLoadIdentity'
jni/main.cpp:96: error: undefined reference to 'glFrustumf'
jni/main.cpp:97: error: undefined reference to 'glScalef'
jni/main.cpp:99: error: undefined reference to 'glClear'

I know its probably something simple but I can't for the life of me figure it out.
These are the includes im using
Quote
#include <vector>

#include <SFML/System.hpp>
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>
#include <SFML/Audio.hpp>
#include <SFML/Network.hpp>

#include <GLES/gl.h>
#include <GLES/glext.h>

I have a few weeks to figure this out but any help in solving this quicker would be appreciated.
Thanks in advance :)

Pages: [1]