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

Pages: [1] 2 3
Feature requests / Batching and other graphical improvements
« on: March 07, 2009, 08:14:59 am »
batch rendering and render to texture/image are set to be implemented in sfml2. As for shaders, GLSL is available in sfml as PostFX. PostFX, as I understand it, is just GLSL with a few SFML-specific macros or extensions. There's a basic tutorial on working with it here: http://www.sfml-dev.org/tutorials/1.4/graphics-postfx.php

General / Unicode errors with VS C++ 6 (aka VS98).
« on: March 05, 2009, 03:39:52 pm »
I'm with astrof, either use the Express version of visual studio or use code::blocks. If you felt like it, you could also use cmake + the cmake-sfml plugin to generate make/project files for a variety of build systems.

Window / Get Key ID When Key Is Pressed? (C++)
« on: February 23, 2009, 04:15:22 am »
It might not be hard to implement, but it's outside of SFML's scope. SFML doesn't provide any GUI elements, and (probably) never will. If you want native message boxes, use a UI toolkit like GTK, QT, or wxWidgets. Like someone else said above, you could also write your own SFML-based message box, with a rectangle or string. Or you could take a look at the wiki, there's the starts of a GUI framework for SFML there. It's called IMGUI.

General / Flexible Object Manager
« on: January 31, 2009, 09:26:42 pm »
Quote from: "e_barroga"
Quote from: "Tank"
Please read the posts more carefully. :)

Using an object manager class, your code could look like as follows:
Code: [Select]

int main() {
  ObjectManager mgr;

  mgr.addObject( new MyObject ); // MyObject derived from BaseObject
  mgr.addObject( new MyOtherObject ); // MyOtherObject derived from BaseObject

  while( true ) { // Some kind of main loop.
    mgr.processObjects(); // Calls step() for every object.

BaseObject has the virtual functions create() and step(). create() can be called in several ways: Either by the constructor or by ObjectManager::addObject(). ObjectManager::processObjects() iterates through all added objects and calls step() on each. I hope it's more clear this time.

You're implementing some kind of factory pattern. I would either prefer to implement functions like: createPlayer(), create...() instead of comparing type strings (we're using OOP ;) ), or directly pass a pointer to the proper object by using the new statement.
For example something like:
Code: [Select]

objectmanager.register( ObjectFactory::createPlayer(), "an_unique_id" );

Yes, I already know about writing an object manager, but I am having issues writing the method to create instances through arguments.

Code: [Select]

void ObjectManager::addObject ( argument0 ) {
  new argument0;

How do I make it create an instance of whatever is defined in argument0?

I don't know much about patterns or anything, but I think a Factory class might fit your need. Look it up, it's pretty nifty.

D / DSFML 1.4
« on: January 24, 2009, 06:46:45 pm »
Ah, okay. Yeah, I've been staying up to date with my svn packages for arch linux, i've just been waiting to package the official 1.4 release. Thanks guys.

Graphics / Draw directly into an image
« on: January 14, 2009, 04:22:43 pm »
Check the roadmap, there's a link to it on the front page. Laurent is already planning to implement render to image. :)

Edit: You might also try PostFX, which uses GLSL shaders. You could colorize your buttons using that, and I suspect it would be a lot easier.

D / DSFML 1.4
« on: January 11, 2009, 08:59:21 pm »
When is the DSFML 1.4 package going to be released?

General discussions / Arch Linux PKGBUILDs
« on: January 01, 2009, 02:40:22 pm »
After a couple days of trying to get my D enviroment working, I've now got my DSFML PKGBUILD written and ready to use. It's available here: http://aur.archlinux.org/packages.php?ID=22788.

I hope somebody gets some use from these. :)

Graphics / Failed to load image
« on: January 01, 2009, 02:45:41 am »
i remember having trouble with this on mac os, as well. Try creating an application bundle for the test app, and use cocoa's bundle-handling code to load your images from the bundle's resource directory. also, try putting the images in the directory above the one the executable's in.

Graphics / Failed to load image
« on: December 30, 2008, 12:35:58 am »
If you show us the relevant portion of your code, we might be able to come up with a solution.

C / IPAddress, SocketTCP, and SocketUDP not including cstring
« on: December 29, 2008, 02:37:14 pm »
I don't know if anybody's noticed this, but  IPAddress.cpp, SocketTCP.cpp, and SocketUDP aren't including the cstring header, which all three require due to the string functions they use. I've included patches below in order to remedy this. (It's a simple edit, of course, but I've never made patches before and needed to learn how. :p) I would have included cstring in CSFML/src/SFML/Network/Internal.h, but saw that IPAddress.cpp doesn't include that, so I included cstring in each aforementioned files. I hope this was the right thing to do.

Patch: IPAddress.patch
Code: [Select]
--- src/sfml/CSFML/src/SFML/Network/IPAddress.cpp       2008-12-29 07:25:23.000000000 -0500
+++ ../sfml/CSFML/src/SFML/Network/IPAddress.cpp        2008-12-29 08:20:12.000000000 -0500
@@ -27,7 +27,7 @@
 #include <SFML/Network/IPAddress.h>
 #include <SFML/Network/IPAddress.hpp>
+#include <cstring>


Patch: SocketTCP.patch
Code: [Select]

--- src/sfml/CSFML/src/SFML/Network/SocketTCP.cpp       2008-12-29 07:25:23.000000000 -0500
+++ ../sfml/CSFML/src/SFML/Network/SocketTCP.cpp        2008-12-29 08:20:25.000000000 -0500
@@ -30,7 +30,7 @@
 #include <SFML/Network/IPAddress.hpp>
 #include <SFML/Network/Packet.hpp>
 #include <SFML/Internal.h>
+#include <cstring>

 // WARNING : this structure must always be the SAME as in Network/Packet.h
 struct sfPacket

Patch: SocketUDP.patch
Code: [Select]

--- src/sfml/CSFML/src/SFML/Network/SocketUDP.cpp       2008-12-29 08:25:35.000000000 -0500
+++ ../sfml/CSFML/src/SFML/Network/SocketUDP.cpp        2008-12-29 08:28:51.000000000 -0500
@@ -30,7 +30,7 @@
 #include <SFML/Network/IPAddress.hpp>
 #include <SFML/Network/Packet.hpp>
 #include <SFML/Internal.h>
+#include <cstring>

 // WARNING : this structure must always be the SAME as in Network/Packet.h
 struct sfPacket

General discussions / Arch Linux PKGBUILDs
« on: December 29, 2008, 01:20:05 pm »
For anybody who's interested, I've just made a PKGBUILD to build SFML from the latest svn revision. It's available in the AUR here: http://aur.archlinux.org/packages.php?ID=22731.

I will also be making PKGBUILDs for csfml and dsfml, they should be ready in a couple hours; and when SFML 1.4 is officially released, I'll also make PKGBUILDs for that.

Edit: The CSFML PKGBUILD is now available here: http://aur.archlinux.org/packages.php?ID=22733. I can't figure out how to upload the three patches I made for it, but those bugs should be fixed relatively quickly and when they are, I'll update the pkgbuild. If anybody is interested, I can tar up the patches and put them on sendfile or megaupload or something.

Edit 2: The CSFML PKGBUILD has been changed so that it doesn't require the patches anymore.

General / why doesnt it work?
« on: December 14, 2008, 03:32:07 am »
Code: [Select]

These need to be inside of your game loop.

Feature requests / "Huge Sprites"
« on: December 11, 2008, 08:09:02 pm »
I think this is a fantastic idea, go for it. :)

D / DSFML improperly named in dsss records.
« on: December 09, 2008, 08:25:12 pm »
Ah, that works. thanks. :)

Pages: [1] 2 3