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.


Topics - bullno1

Pages: [1]
1
SFML projects / sfFlash - Flash UI for SFML
« on: April 08, 2010, 02:23:46 pm »
This library enables you to embed any swf file as your GUI.

It is a free alternative to the pricey ScaleForm.

Here's a screenshot of the library in action:


You can play with the slider and the color picker.

The library consists of 2 part

SwfUI:
This is a fork of Hikari http://www.ogre3d.org/forums/viewtopic.php?t=41999 , a flash UI Library for Ogre .
I stripped away all the Ogre related part and replace them with abstractions.
I also follow SFML design goal and keep everything as simple as possible.

Feature:
-API independent. You can provide your own render API-specific implementation
-C++ can call action script functions. Action script can call C++ functions through a simple interface. Data types are transparently converted.
-Unicode support
-Automatic capture of keyboard input
-Dynamically load IShockwaveFlashObject from a .ocx file so client machine does not need to have flash installed.

sfFlash:
This is the SFML render implementation of SwfUI.

Feature:
-Deadly simple interface. This is how you load a control:
Code: [Select]

sf::FlashControl test(512,512);
test.load(L"controls.swf");
test.SetPosition(100.0f,200.0f);
test.SetRotation(45.0f);//Yes, your control still works even when it's rotated
test.setRenderQuality(SwfUI::RQ_AUTOHIGH);

And render it:
Code: [Select]
window.Draw(test);//window is of type sf::RenderWindow
-Efficient rendering through a dirty rectangle system.
-Automatic conversion between flash data types and SFML data types. Currently, only ActionScript colors (passed as floats) are converted to sf::Color.

Limitation:
-Windows only
-Performance is not good enough. Currently, i'm using glTexSubImage2D to update the texture. My crappy graphic card does not support PBO so I cannot provide a better implementation.

How SwfUI is implemented:
It is the similar to how Hikari did it:
Create a windowless OLE container. Put an IShockwaveFlashObject inside.
Everytime the control need to be redrawn, call OleDraw to draw the dirty part in my own DC.
Copy the dirty part to a separate buffer (make it contiguous) and call glTexSubImage2D to update the texture.
Events are sent using window messages.

TODO:
-A proper tutorial
-Better data sharing between C++ and flash (loading flash files from memory, send image from C++ to ActionScript...)
-Get rid of the annoying exceptions in flash.ocx

Help needed:
-Someone who can implement a better rending technique (through PBO?)
-Someone who is experienced in COM in general and flash COM interface.

Project page(with download links):
https://code.google.com/p/swfui/

2
Graphics / Optimal way to do z-sorting
« on: December 10, 2008, 01:49:33 pm »
Currently, I'm storing my sprites in a std::list then I sort them every frame according to their "z" values through std::list::sort so that I can draw them in the correct order.
To speed it up, I have different lists of sprite called layers. Their their rendering flags decides whether they are sorted every frame(moving object) or sorted only once(background objects)
However, I still want to know if there is a better way of doing this? Does OpenGL have any function to exploit GPU power to do sorting?

3
SFML projects / BGB: Bull's Game Builder
« on: October 13, 2008, 04:23:18 am »
Link: BGB.zip - 0.90MB
Note:
Windows executable
Requires vc2005 redist package.


What it is:

-A game authoring/prototyping tool, similar to GameMaker or Torque Game Builder
-Based on SFML for everything from rendering to audio

What it is not:
-A full featured one bcoz I just started it
-Another SFML Binding

The basic idea is that the engine provided you with basic base classes: Text, StaticSprite, AnimatedSprite. You will write your own classes in Squirrel script which inherit from those base classes.

Features:
-In-game WYSIWYG editing *
-Virtual file system*
-Squirrel scripting, squirrel classes can inherit from C++ classes and override virtual method
-Serialization and Deserialization of a game level(state) to/from file
-Text rendering with unicode support
-Tile rendering
-Static sprite
-Animated sprite *
-Particle system *
-Physic/Collision detection *
-Audio*(can be done anytime, just a direct bind to Squirrel)
-Layer-based, depth-based, coordinate-based sorting for rendering
-Player profile*(something like a save file, a concept borrowed from Novashell)
-Compiles on other platform*

*=planned  :roll: (Too many *, may be I'll mark finished feature with * instead)

What to do in the demo:
Err, watch it, move your mouse around a bit, click left mouse for fun, watch the console window.
Press A to save the current state to file (testMap.map) , press B to load the state.

If you know Squirrel, you can:
-Read main.nut to see how this demo works
-Write a simple game like pingpong with it. Such game is possible at this stage of the engine. You have to iterate the root table to find out the engine's exported functions though.

For those "no screenshot=no download" guys:

Yes, that's all you get for now. As for the FPS, I limited it with SetDesiredFrameRate.

Source code will be uploaded once source forge accept my project. Impatient guys can PM me.

4
Feature requests / Render to texture, Drawing Rect, expose Matrix
« on: October 10, 2008, 02:22:04 pm »
Render to texture is really necessary to achieve some cool effects like motion blur or trail.

Is it possible to make all sf::Drawable to expose their drawing area as a Rect so that I can implement culling?

I also need the transformation matrix to be exposed(set getMatrix to public) because I need to "attach" some a sprite to another. The attached sprite coordinate will be relative to the absolute one of the carrier. I can use a separate matrix for that but it would be better if the original matrix is exposed.

5
Feature requests / Custom file stream
« on: October 06, 2008, 06:17:32 pm »
Currently, the library only support loading resources from file or from memory. It will be nicer if it supports a custom file stream interface where data input can be overriden by users. Something like:

class IInputStream:
{
 virtual void* readData(int size)=0;
 virtual void release()=0;//called when SFML's done with this stream
};

This will give chances for things like: virtual file system, resource protection, mod (files from a mod override files from the original game...), online streaming ...

I know it's possible to load everything into memory, decrypt then feed it to sfml but for streamed resources like video or music, it defeats the purpose of streaming

Pages: [1]
anything