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 - bryce910

Pages: [1] 2 3
1
SFML projects / Server Management Software
« on: September 29, 2016, 09:37:45 pm »
Hey guys!

I have been using SFML for awhile now in game development and small odd jobs. I have decided to finally build a serious project using SFML / C++ that is not game related. I am not sure if this thread is for game projects only but if not, I am hoping to walk through the creation of the SFML / C++ based server management platform.

Not much has been done as I have decided to upgrade my version of SFML and start the project from scratch since my game engine will not be too helpful when building a standard business application.

So for now it was more of an introduction and a small image of what I am looking for it to look like in the next week or so. This will include some external classes to help handle easy UI elements that can be a pain if you are trying to avoid adding more libraries in your project other than SFML.


See ya guys!


2
Hey everyone!

I am having an issue getting the object to move to a point on the map. I have dealt with this before  but for some reason I am unable to get this to work correctly using a very simple codebase.

Here is the code:

//in main
object.setPosition(25, 600);
cordinates.x = 250;
cordinates.y = 0;


//function that is called
    if(object.object.getPosition().x == cordinates.x && object.object.getPosition().y == cordinates.y)
    {
        return true;
    }
    else
    {
        sf::Vector2f _tempPos = object.getPosition();
        sf::Vector2f _targetPos = cordinates;
        float dx = _targetPos.x - _tempPos.x;
        float dy = _targetPos.y - _tempPos.y;
        float angle = atan2(dx, dy);
        float directionX = cos(angle);
        float directionY = sin(angle);
        object.move({directionX, directionY});
    }
 

As the character moves he moves down and to the right instead of up and to the right but from what I have read in examples and etc. I believe to have the write code...but obviously I do not.

Thanks for the help guys

3
General / Re: IOS Linker issue
« on: March 05, 2016, 04:30:57 pm »
Oh crap. Then I have been wasting my time on that because my stuff already works on OSX! Lol

May I ask where the iOS data on github is?

4
General / Re: IOS Linker issue
« on: March 05, 2016, 03:33:53 pm »
The cocoa project is in the examples project. This actually is a completely new application just implementing the cocoa example that is on the github.  I don't plan on doing anything custom till I get the example up and running lol

5
General / Re: IOS Linker issue
« on: March 05, 2016, 03:11:10 pm »
The target is supposed to be iOS, I used the example and set the IOS = true and then opened the project and then compile "cocoa"

6
General / IOS Linker issue
« on: March 05, 2016, 05:43:55 am »
Hey everyone!

So I have been working on getting an ios build up and running and after I have my max OSX up and running correctly. However, I am having an issue with linking up with the ios port.

Code: [Select]
Ld Debug/cocoa.app/Contents/MacOS/cocoa normal x86_64
    cd /Users/example/Desktop/cocoa
    export MACOSX_DEPLOYMENT_TARGET=10.10
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -L/Users/example/Desktop/cocoa/Debug -F/Users/example/Desktop/cocoa/Debug -filelist /Users/example/Desktop/cocoa/Project.build/Debug/cocoa.build/Objects-normal/x86_64/cocoa.LinkFileList -mmacosx-version-min=10.10 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -framework Cocoa -framework Foundation -lsfml-system -lsfml-window -lsfml-graphics -fobjc-link-runtime -Xlinker -dependency_info -Xlinker /Users/example/Desktop/cocoa/Project.build/Debug/cocoa.build/Objects-normal/x86_64/cocoa_dependency_info.dat -o /Users/example/Desktop/cocoa/Debug/cocoa.app/Contents/MacOS/cocoa

ld: library not found for -lsfml-system
clang: error: linker command failed with exit code 1 (use -v to see invocation)


Apparently I have no idea what I am doing and do not fully understand where it is actually looking for the sfml-system file at?


Thanks for the help!
Bryce

7
Graphics / VAO openGL issues
« on: November 24, 2015, 07:45:44 am »
Hey guys!

I have a quick question, I am using openGl and after getting the shaders issue figured out I have ran across another problem that is probably just somewhere in my code.  I am curious though if SFML has any issues with VAO's in opengl?

Code: [Select]
glUseProgram(programId); //very basic shader
glBindVertexArray(vaoId); // VAO holding my VBO data
glDrawArrays(GL_TRIANGLES, 0, 3); // should draw a basic traingle
glBindVertexArray(0); // unbind VAO
glUseProgram(0); //unbind shader

doing this I get the error:


Code: [Select]
An internal OpenGl call failed in Texture.cpp(154)
Expression:
glGenTextures(1, &texture)
Error_description:
GL_INVALID_OPERATION
 The specified operation  is not allowed in the current state

Any ideas?

8
Graphics / Re: Having some issues displaying traingle with openGL
« on: November 22, 2015, 07:12:22 pm »
Hey guys!

After many long hours of working through this I ended up hiring someone to help me fix the problem. Apparently the issue was with my shader::Bind(&shader). Once I switched over to the opengl method of shading the triangle worked and the flickering stopped.

9
Graphics / Re: Having some issues displaying traingle with openGL
« on: November 21, 2015, 11:23:10 pm »
Okay so I got it rendering now but all of the graphics modules I draw are flickering constantly behind the OpenGl object rendered

Code: [Select]
game.gameWindow.pushGLStates();
game.render(*background);
game.render(*object2);
game.render(*playMenu);
game.render(*quitMenu);
game.gameWindow.popGLStates();
glClear(GL_DEPTH_BUFFER_BIT);

glEnableVertexAttribArray(0);
glBindBuffer(GL_ARRAY_BUFFER, vertextBuffer);
glVertexAttribPointer(
0,
3,
GL_FLOAT,
GL_TRUE,
0,
(void *)0
);

glDrawArrays(GL_TRIANGLES, 0, 3);
glDisableVertexAttribArray(0);
game.gameWindow.pushGLStates();
game.gameWindow.popGLStates();
                        game.gameWindow.display();


10
Graphics / Re: Having some issues displaying traingle with openGL
« on: November 21, 2015, 10:52:30 pm »
I have those in the code by the openGL draw sequence:

Code: [Select]
        glDrawArrays(GL_TRIANGLES, 0, 3);
gameWindow.pushGLStates();
gameWindow.popGLStates();
       //back to sfml graphics modale drawing

If I use

Code: [Select]

static const GLfloat g_vertex_buffer_data1[] = {
- 1.0f, -1.0f, 0.0f,
    1.0f, -1.0f, 0.0f,
    0.0f, 1.0f, 0.0f,
};

instead of

Code: [Select]

std::vector<sf::Vector3f> g_vertex_buffer_data;


Then the triangle does draw? Are you not able to use vector3f for verticies?

11
Graphics / Having some issues displaying traingle with openGL
« on: November 21, 2015, 10:18:35 pm »
Okay so I have been working on this for hours and I simply can not understand what I am doing wrong. All I am trying to do is generate a Triangle in my sfml application and  yes I am failing miserably. Can someone explain to me what I am doing wrong?
Code: [Select]
GLenum err = glewInit();
if (err != GLEW_OK)
{
std::cout << "NOT WORKING" << std::endl;
}
GLuint vertextBuffer;
GLuint vertexArrayID;
glGenVertexArrays(1, &vertexArrayID);
glBindVertexArray(vertexArrayID);

glGenBuffers(1, &vertextBuffer);
glBindBuffer(GL_ARRAY_BUFFER, vertextBuffer);

g_vertex_buffer_data.push_back({ -1.0f, -1.0f, 0.0f });
g_vertex_buffer_data.push_back({1.0f, -1.0f, 0.0f});
g_vertex_buffer_data.push_back({ 0.0f, 1.0f, 0.0f });

glBufferData(GL_ARRAY_BUFFER, sizeof(g_vertex_buffer_data), &g_vertex_buffer_data, GL_STATIC_DRAW);
        glDrawArrays(GL_TRIANGLES, 0, 3);
gameWindow.pushGLStates();
gameWindow.popGLStates();

I am not able to get anything to show up even for a simple triangle.

This is all the opengl code I  use including the draw functions

12
Window / Re: Issue with globalBounds() of text on view.zoom()
« on: November 18, 2015, 08:42:43 pm »
We can close this. I found at the bottom of documentation there is the solve for my issue:

http://www.sfml-dev.org/tutorials/2.0/graphics-view.php

13
Window / Issue with globalBounds() of text on view.zoom()
« on: November 18, 2015, 07:27:57 pm »
Hey guys!

I am currently building a small little application but I am wanting to introduce some of the zooming of the screen as part of the game play. The issue is when I view.zoom() everything zooms correctly EXCEPT I am not able to register my hover effect on text. I have to have the mouse below and to the right of the text to get the hover event.

Here is the code I am using:


textItem.getGlobalBounds().contains(sf::Mouse::getPosition(app).x, sf::Mouse::getPosition(app).y))
{

hover();

}
 

works I don't have the zoom view attached and active to the current window.

14
Thank you. I just noticed the different between global and local!



15
Hello guys!

I am working on scaling some textures accordingly and I am trying to figure out how do I get the original size of the sprite after I already scaled the item.

For example:

/* Sprite Size = 800X600 */
Sprite.setScale(2.0f, 2.0f);
/* New size 16200X1200 */
 

How would I obtain getting the value of the original size of the sprite (800 X 600) without rescaling it?

Pages: [1] 2 3