• What Are You Working On? - December 2014
    1,204 replies, posted
[QUOTE=cartman300;46681972]They're 1:1 copy except the .NET one starts with an upper case letter. There is nothing to translate. [editline]10th December 2014[/editline] And use the SFML.NET nuget package just to be sure you're up to date.[/QUOTE] All of the fields are in .NET conventions and half the functions are renamed, dunno what you're talking about. Plus I'm trying to go off the SFML book which straight up isn't working. Nuget package? [editline]9th December 2014[/editline] Or maybe the SFML book is just super outdated? Is 2.0 all that different from 2.1 :v: ? Like the very first test just to see if shit is working doesn't work.
Oh yeah, and GetName/SetName methods are replaced with Name properties.
This is what's happening. In the book, the example code is as follows: [code]#include <SFML/Graphics.hpp> int main() { sf::RenderWindow window(sf::VideoMode(640, 480), "SFML Application"); sf::CircleShape shape; shape.setRadius(40.f); shape.setPosition(100.f, 100.f); shape.setFillColor(sf::Color::Cyan); while (window.isOpen()) { sf::Event event; while (window.pollEvent(event)) { if (event.type == sf::Event::Closed) window.close(); } window.clear(); window.draw(shape); window.display(); } }[/code] My code: [code]using System; using System.Collections.Generic; using System.Linq; using System.Text; using SFML; using SFML.Graphics; using SFML.Window; namespace SFML_TEST { class Program { static void Main(string[] args) { RenderWindow window = new RenderWindow(new VideoMode(640, 480), "SFML Test"); CircleShape shape = new CircleShape(); shape.Radius = 40f; shape.Position = new Vector2f(100f, 100f); shape.FillColor = new Color(Color.Cyan); while (window.IsOpen()) { /*Event event = new Event(); * while (window.pollEvent(event)) * { * if (event.Type == Event.Closed) * { * window.close(); * } * }*/ window.Clear(); window.Draw(shape); window.Display(); } } } }[/code] There is no PollEvent function in RenderWindow for SFML.NET, and as far as I tell I can't make an Event object. I read somewhere that you have to use DispatchEvents instead, but that doesn't take a parameter and the post didn't really explain how it replaces it. When I debug, this line: [code]RenderWindow window = new RenderWindow(new VideoMode(640, 480), "SFML Test");[/code] gives me this exception: [code]An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)[/code] [editline]9th December 2014[/editline] [QUOTE=cartman300;46682032]Oh yeah, and GetName/SetName methods are replaced with Name properties.[/QUOTE] Yeah. While annoying, I did figure all that out. I'm doing some googling and apparently this exception is some 32-bit/64-bit Visual Studio stuff. goodbye my easy build life with Eclipse and Java
I think there are a few differences but they aren't big enough to really matter. There are examples too. [URL]https://github.com/LaurentGomila/SFML.Net/tree/master/examples[/URL] The window example shows the basics. [editline]10th December 2014[/editline] The main difference being .net uses event handlers instead of the polling. Which is much better, if you know how C# event handlers work it should be easy to figure out.
where the fuck is the configuration manager god fucking dammit what even is this IDE [editline].[/editline] There is no configuration manager under the build menu. There's only build, rebuild, and publish. Aaaaeeerrrrgh.
It's the best IDE in the world. Build->Configuration Manager.
Try compiling as pure 32bit or 64bit, the error should resolve then. (Right click project -> properties -> compiling -> target cpu (or whatever it's called, i don't have VS by hand))
Nuget is easier if you don't want to mess with the dll's, because you need to manually copy the native dll's to the binary since it's a bindings library. I used prebuild events for that before I found out about nuget. project -> manage nuget packages, search for sfml
[img]http://i.imgur.com/2naWv38.png[/img] Properties brings me to the pane below where there is no compiling tab, and as you can see there is no configuration manager under build. I had to enable "expert settings" to even get the build tab, but past that I haven't fucked with it at all. There's nothing about target platform or cpu under Advanced in Build either. can I shoot myself yet
What version are you using. [img]http://puu.sh/doEZM/10b8b52e9d.png[/img]
not the right one apparently
Don't get frustrated just because you don't know how to use something. It's not the tools, it's you. Learn with an open mind or help yourself.
I just get butt-mad whenever I have to deal with build configurations and shit that isn't code and a quick google search doesn't solve it. I fixed the issue.
[QUOTE=Larikang;46681571]SFML is slightly higher level i.e. it comes with more handy game constructs cameras for 2d rendering, more 2d rendering primitives, vector objects, and networking stuff.[/QUOTE] whoa, how do the cameras in SFML work and what do they do? in sdl you just make a x and y for camera pos and subtract the object positions from the camera pos or something like that what primitives? sdl2 gives you lines and boxes and that's about it the heck are vector objects and SDL has networking stuff if you have the extension for it
[QUOTE=Dr. Evilcop;46682048]There is no PollEvent function in RenderWindow for SFML.NET, and as far as I tell I can't make an Event object. I read somewhere that you have to use DispatchEvents instead, but that doesn't take a parameter and the post didn't really explain how it replaces it.[/QUOTE] SFML.NET uses an event system more familiar to C#. Instead of polling for events, you add an event handler to an event like so [code]window.Closed += new EventHandler(OnClose); // Or window.Closed += OnClose; // Or window.Closed += (s,a) => window.Close();[/code] and then call window.DispatchEvents in your main loop.
[QUOTE=Foxtrot200;46682225]SFML.NET uses an event system more familiar to C#. Instead of polling for events, you add an event handler to an event like so [code]window.Closed += new EventHandler(OnClose); // Or window.Closed += OnClose; // Or window.Closed += (s,a) => window.Close();[/code] and then call window.DispatchEvents in your main loop.[/QUOTE] Yeah, I'm fairly familiar with event handlers from Java. This operator overloading stuff is new to me though :v:
[url]https://dl.dropboxusercontent.com/u/96502721/S/stuff.mp4[/url] [url]https://dl.dropboxusercontent.com/u/96502721/S/components.jpg[/url] Improved old code, adjusted scale to be conventional. 6 attack types and 6 armor types, each attack type has its own modifier against the various armor types (piercing deals 200% damage to unarmored, but ~75% against heavy armor, etc). Unity's path finding works pretty well, but the controller/movement not so much. I'm gonna have to re-write it to move the units with my own code but still use Unity's path finding. My subclass setup is pretty slick, so creating various unit types or buildings should be cake as soon as I have the core all coded in. Haven't even considered abilities/spells yet though, gonna have to find a way to squeeze that in.
Not sure if I posted this here yet but I'm making Snake in C++ using SDL. I just implemented the smooth animation :dance: [vid]http://novaember.com/s/035413129.webm[/vid]
[QUOTE=cartman300;46677497]Is your project open source, MIT'd and written in C#? If yes i would love you forever.[/QUOTE] [url]http://triangle.codeplex.com/[/url]
[QUOTE=Dr. Evilcop;46682132] Properties brings me to the pane below where there is no compiling tab, and as you can see there is no configuration manager under build. I had to enable "expert settings" to even get the build tab, but past that I haven't fucked with it at all. There's nothing about target platform or cpu under Advanced in Build either. can I shoot myself yet[/QUOTE] In previous VS versions right click on the solution, in the solution explorer, and the configuration manager should be right there. Just update visual studio tho, [url]http://www.visualstudio.com/en-us/products/free-developer-offers-vs[/url]
[IMG]http://i.imgur.com/Sjr84vw.gif[/IMG] using GameMaker again :v:
So, I recently got 64-bit Linux builds up for my LD#31 - "Entire Game on One Screen" - compo entry. [url]http://ludumdare.com/compo/ludum-dare-31/?action=preview&uid=10247[/url] Decided to take a week or so and prepare a framework for this time, one that has support for doing all the things I need for the game. And linking it all to a scripting language, Angelscript in this case. [img]http://i.imgur.com/kF2bPrB.png[/img] 100% of the game logic is written in scripts, with even the state machine and all the game states being fully scripted. And it still runs at a very nice speed, even though it's all interpreted. The hot-reloading really helped with coding the game too. So, I'm now thinking about maybe taking some time and cleaning up the code, removing some of the dirty hacks I did while trying to get it to work on Linux, and generally just getting the code into a more usable state. Though I don't know if people would use such a thing. Either way, the code can be found here: [url]https://github.com/ace13/LD31/[/url]
After 8 hours of messing about I've managed to fit minimum volume bounding ellipsoids to my voxel data of the lacunae. Awesome! Means I'll be able to take rotations and shears into account when I write my correlation function. (I'll write a blog post to explain this stuff soon!) [img]http://i.imgur.com/vkiPCzZ.png[/img]
[QUOTE=proboardslol;46681114]SFML is easier and [b]works on more languages[/b]. Honestly though I see more C# based stuff like Unity. C# is like the language of the future around here.[/QUOTE] False. SDL works in all languages that do C bindings, which is all languages. Including shit like PHP. There are officially presented bindings in C#, Lua, Pascal, and Python ( [url]http://www.libsdl.org/languages.php[/url] ), it obviously works with C++, and there's also a ton of bindings in other languages, such as Ruby ( [url]https://github.com/jacius/ruby-sdl-ffi/[/url] ), Java ( [url]http://sourceforge.net/projects/sdljava/[/url] ), Rust ( [url]https://github.com/brson/rust-sdl[/url] ), Go ( [url]https://github.com/banthar/Go-SDL[/url] ), and probably a shitton more that I can't remember because I'm tired as fuck. Anyway, SDL is the shit. Also it has networking, gfx, audio, filesystem, timer, threading, and more subsystems, even if the first few aren't included by default (although that seemed to only really be the case for SDL1, with SDL2 shit has changed and a lot more has been merged in.
Long time no see. I updated my Tinder bot: [img]https://dl.dropboxusercontent.com/u/99717/TinderAutoV2.png[/img] * Timestamps, because why not * Automatically fetches my authentication token (From a hardcoded facebook ID) * Checks for any new matches when I open the program *- Writes a generic "Hello" message to any new matches * When a new match is made, it also writes a hello message to them * When liking people, if no more is found, it will pause and try again 10 minutes later I can basically set it to run 1000 cycles and just let it idle all day.
[QUOTE=awcmon;46682214]whoa, how do the cameras in SFML work and what do they do? in sdl you just make a x and y for camera pos and subtract the object positions from the camera pos or something like that what primitives? sdl2 gives you lines and boxes and that's about it the heck are vector objects and SDL has networking stuff if you have the extension for it[/QUOTE] SFML's 2d renderer does everything in world coords. You can translate, rotate, and zoom the renderer's view of the world without changing any of your rendering code. SFML has also circles and convex polygons as primitives. I think you can also use OpenGL's primitives (triangle strip, triangle fan, etc.) with the built-in render. Vector objects are used (usually) for representing the size/position of things. They have overloaded operators so you can write stuff like character.setPosition(origin + velocity * time) without needing to access origin.x, velocity.x, etc.
[QUOTE=awcmon;46682214]whoa, how do the cameras in SFML work and what do they do? in sdl you just make a x and y for camera pos and subtract the object positions from the camera pos or something like that what primitives? sdl2 gives you lines and boxes and that's about it the heck are vector objects and SDL has networking stuff if you have the extension for it[/QUOTE] SFML has a "view" class, which does all the math for you. [editline]10th December 2014[/editline] [QUOTE=mastersrp;46685816]False. SDL works in all languages that do C bindings, which is all languages. Including shit like PHP. There are officially presented bindings in C#, Lua, Pascal, and Python ( [url]http://www.libsdl.org/languages.php[/url] ), it obviously works with C++, and there's also a ton of bindings in other languages, such as Ruby ( [url]https://github.com/jacius/ruby-sdl-ffi/[/url] ), Java ( [url]http://sourceforge.net/projects/sdljava/[/url] ), Rust ( [url]https://github.com/brson/rust-sdl[/url] ), Go ( [url]https://github.com/banthar/Go-SDL[/url] ), and probably a shitton more that I can't remember because I'm tired as fuck. Anyway, SDL is the shit. Also it has networking, gfx, audio, filesystem, timer, threading, and more subsystems, even if the first few aren't included by default (although that seemed to only really be the case for SDL1, with SDL2 shit has changed and a lot more has been merged in.[/QUOTE] [url=https://github.com/freebasic/fbc/blob/master/inc/SDL/SDL.bi]Oh look, FreeBASIC also has SDL[/url]
[QUOTE=Zyx;46685857]Long time no see. I updated my Tinder bot: [img]https://dl.dropboxusercontent.com/u/99717/TinderAutoV2.png[/img] * Timestamps, because why not * Automatically fetches my authentication token (From a hardcoded facebook ID) * Checks for any new matches when I open the program *- Writes a generic "Hello" message to any new matches * When a new match is made, it also writes a hello message to them * When liking people, if no more is found, it will pause and try again 10 minutes later I can basically set it to run 1000 cycles and just let it idle all day.[/QUOTE] What is the point of a tinder bot? Is it just to collect matches so that at the end of the day you can just go and see who is willing to hook up and then go down the list? Or is it just for fun?
I think the focus of SFML and SDL are just different. SFML is focused on being an extensive C++ 2d game development framework, where SDL is more focused on being a cross platform API for providing a minimal OS layer. It really just depends on what you want to do, and what you want to use the API for.
General question: I want to start working on Java & SQL and the links between it ( JDBC ). SQL seems easy enough, but the only issue is - how do I actually create an SQL database? Would MySQL be a solution?
Sorry, you need to Log In to post a reply to this thread.