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

Pages: 1 2 [3] 4 5
31
Java / Re: Attempt running jsfml-test.jar, UnsatisfiedLinkError
« on: March 12, 2013, 03:11:53 pm »
Double? That would be impressive.

I think I have seen people do that, come to think of it. Would you recommend following suit and including it in there somewhere? Also, what function does it serve in this case?

For Linux, would you recommend also including those other libraries? My main concern here is, I don't want there to be an error that cannot be fixed, say if the application cannot start, it cannot report an error, either, but they don't know why - OR, Linux users are used to it and just add it at download and/or in a readme.

Read about that, yes. Although... I had thought double clicking jars (on windows, not sure about mac), does not do it - opens it as text. Setting default program, perhaps. Anyway, is there any good cross platform way to detect the java installation ( jre) directory? I would go java -jar somejar.jar, but that only works with java on the path.

32
Java / Re: Attempt running jsfml-test.jar, UnsatisfiedLinkError
« on: March 11, 2013, 04:58:20 pm »
Ah. That did the trick - neat demo, also. The drop from 60-63 to 55 only occurred at about 1000 entities.

Anyway, I had thought that most things branded within VisualC++ were Windows only. You say if you are on windows, though, which seems to imply it is not the case elsewhere. If I were to distribute this, what would I need to include with it?

33
Java / Attempt running jsfml-test.jar, UnsatisfiedLinkError
« on: March 11, 2013, 01:42:41 am »
Greetings. Was going to try using JSFML... I ran the test, though, (jsfml-test.jar), and got an UnsatisfiedLinkError:

Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Users\Kids\.jsfml\windows_x64\sfml-system-2.dll: Can't find dependent libraries
   at java.lang.ClassLoader$NativeLibrary.load(Native Method)
   at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1939)
   at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1864)
   at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1825)
   at java.lang.Runtime.load0(Runtime.java:792)
   at java.lang.System.load(System.java:1059)
   at org.jsfml.internal.SFMLNative.loadNativeLibraries(Unknown Source)
   at org.jsfml.window.VideoMode.<clinit>(Unknown Source)
   at pong.Main.main(Main.java:11)

Note: this is the same error I get when I use jsfml.jar in a normal project in Netbeans, which is where the last live above comes from.

It cannot find the DLLS. At first, I couldn't either. I looked for the C++ DLLS, and tried putting them in the running directory, to no avail. On the wiki I found, it unpacks them to user/.jsfml. I found them there, tried copying them to the current directories, and again, to no avail.

It says it automatically unpacks them... but nothing is running, here. I feel like I am missing something obvious, though.

Any ideas?

34
Network / Re: Odd Error with TcpSocket and HTTP
« on: January 15, 2013, 06:32:53 pm »
Oh. That makes sense.

I am not sure. I believe I meant to have string there - I was trying to see what was contained in the string, and... only send what was expected.

At what point would SFML output an error or description of TCP_NODELAY, and what does it mean?

35
Network / Re: Odd Error with TcpSocket and HTTP
« on: January 14, 2013, 06:52:52 pm »
I thought about that once, but for some reason I assumed that it was a safe operation.

Although... if that is true, what do you think the contents next to it are from? I have never seen the TCP_NODELAY message before now. Perhaps this same program always gets that memory space? Not sure.

It seems to be fixed now. I decided it would be easier to use a string (previously I did 1000 because I would need a variable for the string to get the size somehow...). However, browsers load - or don't load - this for a very long time. I am not sure whether I am sending information inaccurately still, or it is someHTTP thing. I have:

std::string string = "HTTP/1.1 200 OK\n\rConnection: close\n\r\n\r<html><head><title>Title</title></head><body style = \"background-color: lightblue;\"><p style = \"background-color:black; color: yellow;\">Test</p></body></html>";

            for (int i = 0; i < string.length(); ++i)
                std::cout << string;

            std::cout << "\n\n" << string.length() + 1 << "\n\n";

            socket.send(string.c_str(), string.length() + 1);

I think length + 1 is correct here (c_string adds \0)?

Anyway, it "loads" for long time - least a minute. Chrome and Firefox. Sometimes it displays as it should, and other times it times out. Any ideas?

36
Network / Odd Error with TcpSocket and HTTP
« on: January 13, 2013, 11:12:14 pm »
Greetings. After I discovered port forwarding, I decided to try to make my own server, for testing web things. This would be able to, unlike free hosts, offer more freedom, for obvious reasons, such as server-side scripting. Not to mention, I can learn a bunch - say, POP or HTTP and networking things - side by side with networking through the server for games and experimenting with HTML5 and such things.

Anyway, As I was testing the port forwarding, I was able to receive the HTTP requests fine, and regardless of what it said, I sent a test response back, with a rather basic page.

I am guessing my HTTP is pretty bad, but I DID manage to get something. IT appeared as though the browser decided to display everything I said it, as simple as possible. It did display the <p> element correctly. It read:

Quote
Some paragraph here...

Failed to set socket option "TCP_NODELAY" ; all your TCP packets will be bufferedFailed to enable broadcast on UDP socketCannot send data over the network (no data to send)Cannot receive data from the network (the destination buffer is invalid)vector::_M_fill_insertFailed to bind listener socket to port Failed to listen to port Failed to accept a new connection, the socket is not listening255.255.255.255www.sfml-dev.org/ip-provider.php˜6@Â6@Â6@Â6@Â6@Â6@Â6@Â6@Â6@Â6@Â6@Â6@Â6@Â6@Â6@Â6@Â6@´6@Ÿ6@¦6@Â6@Â6@»6@Â6@Â6@­6@vector::_M_fill_insert/GETPOSTHEAD HTTP/. : http/http://https://Fromuser@sfml-dev.orgUser-Agentlibsfml-network/2.xHostContent-LengthContent-Typeapplication/x-www-form-urlencodedConnectionclose$tI

Some paragraph here was my example <p> text, and is not actually another paragraph of relative information. AnywayI don't know where this content comes from, but I assume, somehow, SFML added this on, although I thought the error log normally redirected to the console, (like with a 0x0 texture). So I am pretty lost, but I don't think this is my doing. Anyway, my guess is, this message gets tacked in there with any HTTP/HTML, and so the browser is rather confused, and so making a proper server is a bit impossible till I fix this giberish. All I can assume is that it is an SFML sockets issue.

Not quite sure how to correctly format code in here, sorry.



int main()
{
    sf::TcpSocket socket;

    sf::TcpListener listener;

    listener.listen(11111);

    while (true)
    {
        if (listener.accept(socket) == sf::Socket::Done)
        {
            std::cout << "Connection!\n";

            socket.setBlocking(true);

            char buffer[1000];

            sf::IpAddress other;

            std::size_t t;

            socket.receive(buffer, sizeof(buffer), t);

            std::cout << buffer;

            socket.send("HTTP 1.1 200 OK\n\rConnection: close"
                              "\n\r\n\r"
                              "<!DOCTYPE html><html><head><title>TestPage</title>"
                              "</head><body style = \"background-color: lightblue;\" >"
                              "<p>Some paragraph here...</p></body></html>\r\n"
                              , 1000);
        }

        sf::sleep(sf::seconds(0.01));

    }

    std::cin.get();
}


This with including SFML/Network and iostream, as well as linking with the SFML libs. I used Firefox and typed in the URL bar my external ip followed by :11111 (this rather than 80). I don't think it is a browser issue, though, because chrome displays about the same thing, although is gets the style = "background-color: lightblue" part correct as well.


Thanks if you can help.

EDIT: SFML2-rc from... a few months back. Might be useful information.

37
Graphics / Re: SFML 2 views
« on: August 09, 2012, 04:45:19 am »
I was also confused with view's that's why I researched a bit and then created this tutorial, but as you stated you've probably already read that one. What didn't you understand? I made examples and images which show exactly what the center of the view relates to and how the coordinate system gets affected etc. and added even a full blown example, so I'm unsure what's missing. :-\

Also in most use cases that easiest way to deal with views is just to call move() and not care about where the center point now is located. ;)

Your tuturial was the main one I found. While you state it is fully explained - well, it probably is, but I don't quite understand it. For example, you said that the center is defined from the center (means?) and something about a reversed X axis... I didn't get it at all at that point.

Oh... I suppose I could do that with some maths, yes. Still, the way I did it was like...

if (view goes passed boundary)
set view center to current view center's x, boundary line - half view window width

Wait a second... I think I just found my error.

Ahah. It works - albiet, it looks ugly, but concept proven :)

I think your right, though. Move ought to be <= easiness of positioning the center.

Anyhow - if I understand this correctly... the center of the view is, well, automatically in the center of the view, and thus setting the center moves it. (and thus not like setting the origin). Is that correct?

In that case, zoom and rotate make sense. And if you create the view using a center and size, then is just creates the rectangle as if from 0,0, then move it till the center is equal to the center parameter, correct?

In that case, my only questionns are, how/why are the coordinate systems different (flipped x for example), does the window defaultly use a view, (follow-up to last) how do you control, when using views, what is drawn in what could be called the physical location of the render window? (for example, if a view does not cover the entire screen, and something is drawn within the window regio ncoordinates, will it be drawn there? If so, how could this be prevented? Finally, how exactly it determines what gets rendered (rasterized?) where.

Sorry, lots of questions :)

38
Graphics / SFML 2 views
« on: August 09, 2012, 12:11:02 am »
Greeting all. Learned much in both C++ and SFML since I have been here last. My current project, though, would be much easier with views.

However, even after the doc and a tuturial I found regarding it (there was a forum post on here about it), and some attempts myself, I am very befuddled. In the game engine I had used previously, views were still a bit confusing at times, but simply consisted of variables like width/height of the view/viewport, and something along the lines of position. (top left corner, that is).

SFML views, though, have got me confused. So, I suppose, I can try to explain what I want to do.

What I want to do is, make the view the same size as the rendering region (and same for the viewport, but that is default). I then want this view to continue moving southEast-ish - that is, down and right - to follow a slope. Simply enough, you would think. At first, I first made it as simply sf::View view, and so center was 500/500. I later re-set the center, (as view height/2, view width/2) and this was better. (previously, a line that started at 0,0 was near the right of the screen, still at the top, when it should have been the top left - the view was somehow shifted right), but now looked as expected. Anyhow, this slope of mine is randomly generated. as such, if you use set incriments, you may either end up to far above, or to below, the slope. However, the camera will actually follow the player. I may impliment adding a zoom so the slope always stays in few, we shall see. Anyhow, currently (due to 'dropoffs" in the slope), I make it so if the view is further down then the highest point currently in view (more or less - technically, it is a point that was the highest when the last highest goes out of view), so when the player goes out of view, I can kill them and it isn't so ugly.

When I added this, though, the lines were there one second and gone the next. The y position went from 300.2 to -299.8, causing it to go out of view, I beleive. I just have no idea why. This prompted me to make this point - I figure things will all be easier if I understand just how allthe aspects of views work as they are implimented in SFML, specifically how the center works - what is it set relative to? How does it affect transformations?

So I suppose I am asking if somebody can go over each aspect of views and explain quite how they work, with emphasis on coordinates and the center.

I realize that is a bit general, but I feel it would all be useful information on a concept that, if the tuturial is any indication, and my own confusion at the lack in the documentation (setCenter is "set the center of the view", a fact I understand from the name but I don't really know exactly what that does, for exactly what it is relative from?)

Thanks if you can help clear this up for me at all.

39
General / Re: More Problems...
« on: June 15, 2012, 06:59:08 pm »
Preprocessing as in the preprossesor, which is sort of a text editot, as in #define? (or commonly, #include)

I think I get compiling and linking. Compiling it makes object files, (Still not quite certain how those work by themselves, though), and the linkers combines them into the exutable. Import libraries... I thought I had an idea of what a run time library was, but in that case I might not be especially studied on an import library, so not much on either. Shared vs static, most definetly confused how they work. It seems the jist of it is one exutable (static) vs exutable with libraries stroed seperately with it (dynamic, shared, etc)... never knew what a .hpp was either before I saw SFML.

Most people probably could. Generally people get annoyed because I ask to many questions :) unfortunately, I cannot find many sources that go into much detail on most notably dynamic/static libraries, and other similar things. Do you know of a source that provides more detail on the subject?

One thing I still wonder is, HOW programming started. There were high leveled languages.. scripiting languages.. html stuff... machine, assembly, etc. but how did it even understand anything in the first place? Hrm.

40
General / Re: More Problems...
« on: June 13, 2012, 08:03:06 pm »
Ah... I had been thinking of something else, and also was a bit confused on how you link to the .a libraries, but include the DLL's. Guess that was where I made my mistake, sorry.

So, to be clear: When linking dynamically, you link to the .a libraries but include the DLL's with the exutable?

Then, assuming I am using GCC, (MinGW) to link statically I can just not include anything and use the -s libraries instead?

Not sure why I am so bad at this. It is like all my troubleshooting is in the wrong places...hrm. Quite sorry.

41
General / Re: More Problems...
« on: June 13, 2012, 07:03:07 pm »
I copied the .a files to the directory... I don't seem to have any ending in.dll. Am I missing libaries, and if so, how could I get them? Only thing in sfml-directory-here/lib is the .a files - the .a, -s.a, -d.a, and -s-d.a, the various from of each library for the five modules. Nothing else. Twenty libraries. Am I missing some?

42
General / Re: More Problems...
« on: June 13, 2012, 03:31:53 am »
So I thought. Why, then, can the program "not find" this non-existant library, you think?

I looked back but did not find any spelling errors. What do you mean?

43
General / Re: More Problems...
« on: June 12, 2012, 10:05:04 pm »
Found them. Seems it is a bit different then the way it worked for me with the rc last time... hrm.

Um... Windows32 bit... whatever one had code:blocks and mingw in it, I  think. I will check.

http://www.sfml-dev.org/download/2.0-rc/SFML-2.0-rc-windows-32-gcc4-sjlj.zip

EDIT:

Thisthe wrong release?

Also, Itried following the tuturial that is up now, same problem, so I am not sure where the problem likes exactly,but no libraries with a 2 seem to exist. Ideas?

44
General / Re: More Problems...
« on: June 12, 2012, 09:47:17 pm »
Tuturials exists for SFML 2 now?

I downloaded the release candiate... your saying sfml-xxx-2 libraries exist?

45
General / More Problems...
« on: June 12, 2012, 08:22:18 pm »
Greetings all. A while back, I came here trying SFML as my first library, and had extensive troubles getting it to work (dynamically), but finally got it with help. Then , I tried it using a new computer, and it doesn't work anymore.

I  am using Code::Blocks with MinGW.

I made a new, empty project.

I went to project > properties, then set it to a GUI application for both debug and release.

I went to project > build options, search directories, and added the SFML/include folder for compiler, andlib for linker.

I went to other linker options, and had -lsfml-window, -lsfml-graphics, -lsfml-system. Although, I got the same results linking the respective libraries in that order the other way, both tried seperately.

I put those dlls (window, graphics, and system) - the plain .a versions of the libraries, as I was doing it dynamically.

Made some test code, included the libraries, with system first and the others following (I switched them to see if that was the problem but it wasn't). At first I screwed up but then I recalled you need the .hpp. Hrm.

I ran it, and get this error: The program cannot start because sfml-graphics-2.dll is missing. Try reinstalling...

etc. Anyhow, far as I know, backed up by searching in /lib, such a library does not exists. I tried removing the #include for the graphics mudle, and it jumped to system, so it does not seem to be a specific one. It seems as though it is quite similar to the problem whenyou don'tput the libraries next to the .exe, but I did. (In bin/debug/ , I think.)

Any ideas how to fix this? I feel like it is simple, but cannot find an answer. Searching the internet seemed to mention something about this occuring because you weren't using the debug libraries, but experimentation with this also proved to be inconclusive. They also mentioned Visual, so mabye that is why.

Can anybody offer me some guidance on how to fix this?

Pages: 1 2 [3] 4 5