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 - Christopher Jozwiak

Pages: [1] 2 3 4
1
SFML projects / --
« on: April 18, 2019, 01:59:36 pm »
--

2
Network / Re: Noob network problem...
« on: May 07, 2017, 07:38:25 pm »
In the above code I changed port 50003 to 20000 and the client is connecting to 127.0.0.1 on 20000. It times out after some time. How would I have the server listen to 127.0.0.1:20000?

3
Network / Re: Noob network problem...
« on: May 07, 2017, 07:26:09 pm »
And your server and client run on the same device (i.e. your PC)?

Yes, this is correct. The server listens properly I made some changes to the error blocks. The server now outputs to the console "Listening on port 20000" and the code is after the binding section in said server code. So it opens the port properly. The problem is in the client or my PC.

4
Network / Noob network problem...
« on: May 07, 2017, 06:04:34 pm »
Afternoon or it will be when I'm done writing this post.
I have issues. Many many issues. My program compiles fine, both of them rather. My troubles ensue when I have my server and client open. Nothing is displayed and nothing happens. I am utilizing the basic code from the official networking tutorial, all that has changed is the port.

Code is the same as tutorial pretty much but:
Server:
(click to show/hide)


Client:
(click to show/hide)

The consoles display a blinking cursor and nothing else. I'm a noob with network programming. Enabled the port in my firewall, still nothing.

Edit 1:00 PM :
Server binds to port properly but client is unable to connect to the port. I feel as if it's something with my network.
I am running ubuntu 16.04. Not sure if something blocking something Fajsg;jaksjfg;lkajskrlgjlka. Yep.

5
Graphics / Crashing with drawTo Function.
« on: January 22, 2017, 04:55:24 pm »
Hello,
I've been trying to figure this out on my own.  I just started playing around with SFML again and I usually am able to move stuff around to make it work but I want to be able to understand what actually is going on.  I've had problems simplifying my code in the past to where the issue is, but here goes nothing.

Grid Class
Grid::Grid(int arraySize){
    arraySize = arraySize;
    gridLines[arraySize];
    std::cout << arraySize;
}
void Grid::drawTo(sf::RenderWindow &mWindow)
{
    for (int tRun = 0; tRun <= arraySize; tRun++){
    mWindow.draw(gridLines[arraySize]);

    }
Main Class
//Everything else in the file is irrelevant (Game Loop Stuff)
grid.drawTo(gameWindow);
 

6
Graphics / Re: Nothing drawing to screen
« on: July 02, 2016, 05:33:20 pm »
Aha!  :-[ fixed it... I was indeed using the wrong set function for setting the size.

7
Graphics / Re: Nothing drawing to screen
« on: July 02, 2016, 05:07:04 pm »
Hi,

The code example you provided seems to be incomplete, what does your main cpp look like and what are you trying to draw?


I see you are trying to draw test, but what is test?
window.draw(test);
 

The test variable is a sf::RectangleShape.  I've tried drawing text too.  I added code to set it and posted all of the cbEngine.cpp file.

8
Graphics / Nothing drawing to screen
« on: July 02, 2016, 04:46:22 pm »
I think somethings wrong with my Game loop.   I set everything up as it should be; Clear screen, Draw stuff, Display but it doesn't seem to be working.  I'm trying to work with classes, not going so well. It runs, the window opens and clears to white or whatever I set it to. 



cbEngine.cpp
#include "cbEngine.h"

cbEngine::cbEngine(int screenWidth, int screenHeight)
: mWindow(sf::VideoMode(screenWidth, screenHeight, 32), "App")

{


}

cbEngine::~cbEngine()
{
    //dtor
}

sf::RenderWindow& cbEngine::getWindow()
{
    if (runonce == true){
    std::cout << "Window Created" << std::endl;
    }

   return  mWindow;
}
sf::Event& cbEngine::getEvent(){
    return e;
}
void cbEngine::eventLoop(sf::RenderWindow &window, sf::Event event){
    if(runonce == true){
    std::cout << "Event Loop Initialized" << std::endl;
}
    while(window.pollEvent(event)){
        if(event.type == sf::Event::Closed){
            window.close();
            std::cout << "Window Exited by User." << std::endl;
        }

    }
}
void  cbEngine::runGame(sf::RenderWindow &window){
    stateManager sManager; //Create instance of stateManager class
    splashScreen splaScreen;
    splaScreen.setText();
    test.setFillColor(sf::Color::Red);
    test.setScale(sf::Vector2f(80,80));
    while(window.isOpen()){
            if (runonce == true){
            std::cout << "Window open" << std::endl;
            }
            //---Do Only if Debugging---//
    // Check to see if runonce is true; if true output to console that game is starting. //
    while (debug == true){
        if (runonce != false){
            std::cout << "Starting game..." << std::endl;
            runonce = false;
        }
        break;
    }
    // End of Debug Section //

    // Loop Structure 1.Clear window (Color = black) 2. Call stateManager 3. Display window //
    eventLoop(window, e); // Call event loop Initialize it with window and Event object
    window.clear(sf::Color::White); //Clear window black
    //sManager.selectState(getWindow());// Section not working WIP
    window.draw(test);
    window.display(); // Display everything to screen
    }
}




 
cbEngine.h
class cbEngine
{
private:

        //Declare Core Variables
        sf::RenderWindow mWindow;  //Create Base window object
        sf::Event e; // Initialize system event object
        bool runonce = true; // Boolean for running testing conditions only once (otherwise they'd run non stop alongside window.)
        bool debug = 1; //If Debug True certain conditions will be met and testing variables will be output to screen(Exclusive to Engine class)
        sf::RectangleShape test;  //Rectangleshape test
public:
        cbEngine(int screenWidth, int screenHeight); // Initialize Engine with integer screenWidth, screenHeight
        virtual ~cbEngine();
        //Declare core functions//
        //----------------------//
        sf::RenderWindow &getWindow();  //Returns main copy of window object
        sf::Event &getEvent();  //Returns main copy of event object
        void runGame(sf::RenderWindow &window); // Game Loop Runs through logic and displays everything to window
        void eventLoop(sf::RenderWindow &window, sf::Event event); //Runs through events


        //---End Declaration---//

    protected:

    private:
};

#endif // CBENGINE_H
 

#include "includes.h"

int main(){

    cbEngine Engine(800, 600);

    std::cout << "Main" << std::endl;
    Engine.runGame(Engine.getWindow());


    return 0;
}

9
Window / Re: Text not drawing
« on: July 02, 2016, 12:37:46 am »
Disregard. I repeat, disregard.  I got to ahead of myself.  I started creating a ton of classes at the beginning of the project.  Instead of testing to see if every class was functional I was throwing code in each file to get them all to work together.  Building a new engine.  Much better to think things out before throwing code in a file.  ::)

10
Window / Re: Text not drawing
« on: July 01, 2016, 08:41:50 pm »
Alright, still having the problem.

Here is the portion that won't work.
gameManager.cpp
while(mWindow.isOpen()){
    mWindow.clear(sf::Color::Black);
    lManager.onMenu(mWindow);

    mWindow.draw(lManager.Exit);
    wManager.windowDisplay(mWindow);
    eManager.eventLoop(mWindow);
    }
levelManager.cpp
void levelManager::onMenu(sf::RenderWindow &mWindow){
    stateManager sManager;
    loadFonts();
    setText();
    posManager();
    int state = sManager.getState();
    if (state == 1){
        mWindow.draw(Start);
        mWindow.draw(Exit);
        std::cout << "OnMenu";
    }
I've made sure the state interger is initialized to 0 and "OnMenu" but no text is displayed to the window. Everything runs though without error.  The font is loaded as well.

11
Window / Re: Text not drawing
« on: July 01, 2016, 06:08:44 pm »
Thanks for the info I will start using those guidelines for posting code.  I didn't upload all the files.  Could of swore I did, but I didn't check.  I think I know what the problem is.  If not I'll post all of the code for more assistance.

12
Window / Text not drawing
« on: July 01, 2016, 03:10:43 am »
I can't figure out why my text won't display to my window.  I reference mWindow with each function.  Anyways the codes in multiple files so I uploaded it to a repository on GitHub. https://github.com/Sianide4000/Swaric-Game-Engine

13
Window / Passing in reference.
« on: June 28, 2016, 02:41:16 am »
I'd like to start off by saying I have read a C++ book. 
That said, I'd had a working example of using a reference to pass in the window to different files.  However the problem I had was having to pass in sf::RenderWindow &mWindow to pretty much every function that needed the window.  The problem lied when I tried to split off functions into different files I couldn't get the actual copy of the window I needed.  The deeper down the hierarchy I got it seemed I was getting lost in what I was trying to do.  It was a logic problem but I'm contemplating on how I could use one function to get a copy of the window.  Just looking for advice. =)

14
Window / Re: BSOD when calling function...
« on: March 14, 2016, 03:10:46 am »
Yeah.  I'm using the current drivers for Windows 10.  I can display a window just fine.  The program didn't crash until I pressed the space bar 3 times which called the app.create() function to put it to full screen.  I didn't have an escape case.  It would just full screen the window again and again.

15
Window / BSOD when calling function...
« on: March 13, 2016, 03:26:45 am »
Let me begin by saying all my code is gone.  Not that it was much; I was just messing around with stuff.  It was one file "main.cpp".  After the BSOD when I reboot the file in reference was blank.  When I opened it up with notepad ++ it was filled with the word null that filled in where all my code was.  Nothing remains O_O. 
Now for the code.  It was a basic loop that displayed a window normally and drew text on screen that scrolled across.  I had a for loop for the movement of the text that was based off a clock I initialized.  Anyways everything worked fine until I tried messing with a key press and calling the function app.create(sf::VideoMode(800, 600), "App", sf::Style::FullScreen);  It worked fine but when I hit the F key multiple times my computer crashed and displayed something about dxmms.sys failing.  I don't plan on doing that again, just was wondering why this could have happened.

Pages: [1] 2 3 4
anything