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

Pages: 1 ... 82 83 [84] 85 86 ... 89
1246
Feature requests / Enabling/Disabling config file
« on: November 03, 2010, 12:07:16 am »
If you really want it minimalistic, use only the sf::Window class and have OpenGL render the graphics for you. That's as minimalistic you can be.

If I remember correctly, sf::RenderWindow uses OpenGL in the background but hides it from you?

1247
Feature requests / Enabling/Disabling config file
« on: November 02, 2010, 11:03:06 am »
There won't be any gain in performance by removing, only a smaller executable which might be the goal. The only "overhead" which is microscopic would be when the executable is loaded into memory.

But anyway you don't need to link against every SFML library, only the ones you use. So for instance from what you've told us your only using the Window and System libraries. So those are the only ones you need to link against. You don't need to link against jpeg lib och freetype lib since the SFML libraries already does that for you. If your trying to get the last squeeze of performance then by removing freetype and jpeg will give you none. If you are like I said trying to get a smaller executable then having the SFML libraries being dynamically linked will give you as small executable as you can possibly get trough any tweaking with SFML.

1248
General / rbSFML
« on: November 02, 2010, 10:14:45 am »
Code: [Select]
Is it really a good thing? Is this kind of technique widely used in Ruby?

It's widely used in the standard library for like arrays so you can both call on "size" and "length" on them but it still calls the same method.

Sent you a mail with my login :)
Just gonna compile together my SFML 2 snapshot now.

1249
General / rbSFML
« on: November 02, 2010, 09:05:24 am »
I'm working on SFML 1.6 but thanks for letting me know. I'll switch over to 2.0 if you feel that's better. And making the library both support the convention of SFML(which I feel looks better) and Ruby is easy since Ruby supports something called Aliasing which makes one method/function have several names.


Quote
And if you need a write access to the SVN, let me know.

That would be perfect. We use SVN on my university for the game projects. Send me a mail/message with the specifics and any other information you need me to know.

1250
General / rbSFML
« on: November 01, 2010, 11:20:54 pm »
Long time since I was at this forum :)

Well I need a project to work on in between my assignments while at my university so I choose this if the previous maintainer don't mind.
Anyway I started today and already got the sfml-system library done. I will try to make the library conform with the conventions of the SFML library as much as possible but I will also let the library conform to the Ruby conventions. I can't estimate any time as of when this will be completed but I can estimate that I'll work around 1-2 hours each day with this between my assignments.

The task list for rbSFML can be found here: http://taks.groogy.se

Any updates to the library will be edited into this post.

Example code:
Code: [Select]

require 'sfml/system'
require 'sfml/window'
require 'sfml/graphics'
require 'sfml/audio'

app = SFML::Window.new [800, 600], "My Ruby SFML"

# Load a sprite to display
image = SFML::Image.new
image.load_from_file  "cute_image.jpg"
sprite  = SFML::Sprite.new image
 
# Create a graphical string to display
arial = SFML::Font.new
arial.load_from_file "arial.ttf"
text = SFML::String.new "Hello SFML", arial, 50
 
# Load a music to play
music = SFML::Music.open_from_file "nice_music.ogg"
# Play the music
music.play
 
# Start the game loop
while app.open?
  # Process events
  while event = app.get_event
    # Close window : exit
    if event.type == SFML::Event::Closed
      app.close
    end
  end
 
  # Clear screen
  app.clear
 
  # Draw the sprite
  app.draw sprite
 
  # Draw the string
  app.draw text
 
  # Update the window
  app.display
end


These classes has been excluded from the library:
Code: [Select]

Thread
Lock
Mutex
Randomizer
Sleep
Unicode
RenderTarget ( Not the same as SFML::RenderTarget )

Why these has been excluded is because the core of Ruby already does these for us. But I also want to go into more detail on Thread, Lock and Mutex. It's true that Ruby does provide this functionality for us but it's still incomplete. The threading in ruby works natively but ruby got a global lock which will always only let one thread run at the same time. So this also made my choice, since if we allow SFML threading it might mess up the internal workings of Ruby. So my choice is to wait with implementing this and let Ruby's threading "mature".

1251
General discussions / Newb question about LGPL license
« on: May 09, 2009, 10:59:32 am »
Quote from: "retrogamer4ever"
I see, so as long as I have those .dll files in there and I don't modify the source I don't have to share my projects source code?


Yah pretty much. Depending on what license you use yourself. Though I don't know if you have to provide a text file with the LGPL conditions which only applies to the SFML libraries?

Anyway, you do know that Open Source can still be commercial. You can sell your product but still give them the source code with the binary. Though you'll have to do some tweaking with the license agreement or use one of the already done.

1252
SFML projects / SFML Bindings for mSCRiPT
« on: April 27, 2009, 11:38:42 pm »
I managed to fix the VC++ bug. So now it works perfectly and I got the System package done. I'll try to get some debugging done with the package tomorrow.

1253
General / Weird thing with speed.
« on: April 25, 2009, 12:35:32 am »
Erhm don't know. Maybe.

Code: [Select]

void Application::EnterMainLoop(int argc, char * argv[]) {
// Will just display a background
GUI::MainMenu menu(this->appSender, this->mainWindow.GetWidth(), this->mainWindow.GetHeight());

// Here's where I start with the text to be put on display.
sf::String frame("", sf::Font::GetDefaultFont(), 15); char str[64]; frame.SetCenter(120, 0);
frame.SetPosition((float)this->mainWindow.GetWidth(), 2); frame.SetColor(sf::Color(0, 0, 255));
while(true) {
// Get events from SFML and turn it into signals
this->appSender.FetchEventsFromWindow(&this->mainWindow);
// Add a repaint signal to let know all the objects to be repainted on screen
this->appSender.AddSignal(RepaintSignal(&this->mainWindow));
// Send signals to all objects
this->appSender.SendSignals();

// Put "Time: x.xxxxxx" on the display.
sprintf_s(str, "Time: %.4g", this->mainWindow.GetFrameTime());
frame.SetText(str);
this->mainWindow.Draw(frame);

// Update display
this->mainWindow.Display();
}
}


This is my main loop. So dump something similar to the main function? The interesting thing is that the speed increases? If it's accurate. The thing is that it shouldn't be eliminated but taken advantage of. Somehow. Or maybe the timer is just off.


**EDIT**
Maybe this is enough?

Code: [Select]

sf::RenderWindow window(sf::VideoMode(800, 600), "Test");

// Create and position sf::String frame here
while(true) {
window.Clear();
sprintf_s(str, "Time: %.4g", window.GetFrameTime());
frame.SetText(str);
window.Draw(frame);
window.Display();
}

1254
General / Weird thing with speed.
« on: April 25, 2009, 12:24:54 am »
I noticed a thing. I got it printing out the elapsed time between frames.

And it first prints out between "Time: 0.0063...." to "Time: 0.0059...". Aight now comes the weird thing. When I grab the window, and move it and then releases it. This is decreased to 0.002 and sometimes even 0.001 and it continues at that speed for the rest of the lifetime of the application.

Is this a bug? Has it been noticed before?

I'm on Windows Vista when I tested this using the VC++ 2008 version of SFML.

1255
SFML projects / SFML Bindings for mSCRiPT
« on: April 21, 2009, 09:34:43 pm »
Oi ^^

I've developed a language called Madness Script(mSCRiPT) and I'm thinking about making bindings for SFML to the language.

Though I'm just wondering some things.

If I create it and it work's perfectly. Can it be posted under the download page? Marketing you know :P

Is there some things I should know? I haven't made bindings before. The Dev API for the language is in C++ so it should be fairly easy to make it available in mSCRiPT. Should I change in the source code directly or make a wrapper around SFML?

It will be something like this:
Code: [Select]

SFML = PluginManager.RequestPlugin("SFML")
window = SFML.NewWindow
window.Display
// more code more code


** EDIT **
Remembered that SFML is divided into packages so it should be like this:
Code: [Select]
SFMLSystem = PluginManager.RequestPlugin("sfml-system")
SFMLSystem.Sleep(0.05)


Though should the bindings automatically link the packages they depend on? I.E. Should Window link System by itself or should the developer do that himself?

** Tragic end **
I think I can't do this. Not sure. I can't get my Dynamic Linker to work properly with VC++. It works perfectly with GCC/G++. But VC++ won't accept how I handle the external functions and create a "unified" form of argument list.

Unless someone can help me with that, I'm dead stuck.

1256
Graphics / Drawable.GetPosition()
« on: April 19, 2009, 12:47:58 pm »
Damn it! I thought I looked smart <_<

1257
General / install question
« on: April 19, 2009, 12:46:11 pm »
Put the DLL in a folder that exists in the PATH(env var), like System32 or something like that. Or you can place them in the same folder as the executable. That will make it work.

1258
Graphics / Drawable.GetPosition()
« on: April 18, 2009, 11:31:20 am »
Quote from: "Nexus"

Second, there is mostly no reason not to declare getter functions const:
Code: [Select]
float GetX() const
{
    return self.GetPosition().x;
}


Yes there is. If the reference to the object is constant then only the constant function works. The const keyword promises that the function does not change the internal state of the object.

1259
Window / Removing the console
« on: April 18, 2009, 11:24:43 am »
Quote from: "Nexus"
Anyway, a tutorial is not really a good way to learn C++. It's possible, but much more tedious than a good book.


I want to move in to a library of Programming books... *Drools*

1260
Window / Invisable title bar
« on: April 14, 2009, 01:06:36 pm »
Quote from: "Laurent"
Quote
A guess is that, using XLib to open a window makes it incompatible to the Compiz engine? So maybe a better solution is to use GTK to open? Nah I don't know.

Yeah, you don't know :D
XLib is the low-level API for windowing on Linux, other APIs (including GTK) are built on top of XLib.


Yea but the problem is Compiz, I think it uses GNOME's functions to do what it do. So maybe Xlib opened windows are not compatible with it.

Pages: 1 ... 82 83 [84] 85 86 ... 89
anything