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

Pages: 1 2 3 [4] 5
46
General discussions / (No Longer) Available
« on: October 22, 2013, 07:51:26 am »

and here is the video in question, unblocked, after the shitstorm that TB started:


Basically just watch and up vote the videos, the more noise the better. :P
I know this might be considered spam but this concerns everyone of us here.
If the current trend of shoot-first-DMCA continues, we might some day make a game, post a video of it on our channel and get banned because some company's automated process claims our game or assets belong to them, it's normal practice for bots to tag videos and not unheard of that companies troll with strikes and take down or monetize videos they do not own without any consequences to themselves.

47
Graphics / Performance implications of global scale
« on: October 20, 2013, 02:25:38 am »
What I basically want is scale entire world by 1.f/32.f(so a 64x64 rect is now 2x2, position 32,32 is now 1,1 etc.) and use same view zoom to compensate so everything looks same, are there any negative performance implications coming from OpenGL from this?
I imagine not because it's doing same operations as it would with normal sizes and scales but I want to make sure. :P

48
Clipboard support, straightforward, two functions, one returns std::string by value, other takes std::string by const &, set and get text, does nothing and returns empty string if clipboard is unavailable. (UTF-8 preferably)

Opening with default app: you specify a file path(in UTF-8 preferably too..) and it'll open that file like a double click in file browser would, so .txt will default to notepad or whatever has been set as default in system, html will open in current browser, images in editors or image viewers etc. Can do nothing if not available. Maybe with bool returned to specify whether or not it succeeded.

Uses for both are many and api complexity and bloat minimal, plus it adds one or two headers and three functions without changing or taking anything away so it'll not break existing apps.

49
This is my messily coded editor that I'm making for my own use. Ideally it'll support serialization, scripting and be so-so Box2D editor while also letting me work with entities made out of components in my game. I'm also trying to just make big part of data drawables(world, tool specific..), all physicals and entity data etc. accessible to classes derieved from Tool so the editor's main loop is just: handlevents(send clicks and moves to tools, let gui know etc.)->clear->drawall->drawgui->display. So far I can add boxes and rotate them and simulate it(editor runs using b2World that never steps and for simulation it clones everything), also display it in simulation (old EEDebugDraw3 class I once posted, original Box2D colors) and in editor(code copied from Box2D but with addition of some things like alpha controllable from gui and highlighting current fixture/body, goal is to make it use customizable colors).
I'm 100% sure it'll never support undo because I can just save often or implement some auto-save or something and because I'm not going to even try and learn to implement command pattern AND editor at once. There is still lots of missing and it's very rough and tool buttons and settings are often placeholders but at least it's a start and it displays and doesn't crash. :)




50
General discussions / Small correction to src/Graphics/Image.cpp
« on: May 22, 2013, 05:52:35 pm »
Starting at line 236:
Quote
void Image::setPixel(unsigned int x, unsigned int y, const Color& color)
{
    Uint8* pixel = &m_pixels[(x + y * m_size.x) * 4];
    *pixel++ = color.r;
    *pixel++ = color.g;
    *pixel++ = color.b;
    *pixel++ = color.a;
}
The operator marked in red serves no purpose in this function.
Sorry.. ;D

51
General discussions / Missing const char * overloads
« on: May 12, 2013, 04:34:20 am »
My question is, why some functions do not have overload for const char * but only const std::string& while const char * would make perfect sense.
Examples are basically all over the SFML with sf::String's constructor being proud example that you can actually pass c-string somewhere without the std::string terrorizing you with memory allocations.
Now: loadFromFile is not such a big deal, few dozen characters at most, unless you're loading things from insane filepaths, but loadFromMemory on sf::Shader is just evil. Shader source is expected to be quite long(at least around few dozens, going up to few hundred at most, but still much more than a path would have).
Also: other loadFromMemory take void * so why does loadFromMemory for Shader break out so much and instead of taking const char * take const std::string& which will probably copy quite a lot characters for no reason, and then call c_str() on that anyway while it could work perfectly good on my const char * that isn't in std::string?
Honestly if there was choice between the two, victory should go to const char *(but I'm not saying to remove std::strings from apis completely, just don't force it, especially with sf::Shader), you can go from std::string or any other reasonable string to const char * easily with c_str() or equivalent but to go from const char * or other string class class to std::string requires a copy.

52
Windows exe:
https://docs.google.com/file/d/0B8dEkQw1a4WvaXJDSGk4dTR4ZFU/edit?usp=sharing

Code and 'assets'(compiles on both Windows and Linux with no changes at all):
https://github.com/FRex/Man

It's not that great and has some nasty design but it's very simple and works well enough as a clone. It even has the original PacMan ghost passing through bug. :)
Have fun.

53
SFML projects / Lua SFGUI Loader
« on: April 21, 2013, 08:04:58 pm »
I wonder why Lua highlighting works but isn't selectable from the combo box when writing..
https://github.com/FRex/Lua-SFGUI-Loader
So, I made a LuaTable class and an InterfaceLoader class that change this:
-- this file has been proudly written in gvim ;)
win1 = {type="Window",
        x=200,
        y=100,
        colspacing=8.0,
        rowspacing=8.0,
        shadow=true,
        background=true,
        titlebar=true,
        caption="The Fu*k Java SFGUI Example",
        resize=true,
        widgets={
                {
                        type="Label",
                        text="Is c++ better?",
                        spanx=3
                },
                {
                        type="Button",
                        text="Naturally",
                        y=1
                },
                {
                        type="Button",
                        text="Of Course",
                        x=1,y=1
                },
                {
                        type="Button",
                        text="Yes!",
                        x=2,y=1,
                        OnLeftClick="correct"
                }
        }
}
 
Into this:


All you can do is get is a window with a table in it and you can place widgets in it, that's it.. no limit on number of widgets or windows, though.
Only supported so far to place in that table:
-entry
-spinner
-spinbutton
-image
-label
-progressbar
-scale
-scrollbar
-button
-togglebutton
-checkbutton
-combobox

Notice there is no radio button(edit: now there is), I'm still thinking how to handle the fact they are grouped.

It requires the change of delegates to std function that I posted few weeks back in SFGUI thread.
It may be buggy, Tank will probably release his yaml gui loader tomorrow anyway and it'll be 10x better(because f. my life  ;)). Also it depends on std::bind from c++11,Lua, SFGUI,SFML(duh..) and there are two line that use PhysicsFS but it can be easily replaced to use whatever you want. There are two std::function callbacks: creation and message, OnXXX props in widgets send the widget and the string to message callback, creation callbacks gets sent entire luatable of the widget and the widget pointer.
Also LuaTable class is pretty neat I'd say. If anyone is still interested after seeing all the disadvantages, I can share the code but neither loader nor lua table are fully ready imo.

Here's exe demo, you can play around with it, it got both callbacks set to std::cout the type of widget in creation or the message string in message callbacks.
https://docs.google.com/file/d/0B8dEkQw1a4Wvb1QzR0wyaEt2aWs/edit?usp=sharing
type can be "sfg_label" "sfg_entry" etc. for labels, entries and buttons there's text property that is string to show, for button, toggle button and image there is image which is path to image to load etc. figure it out or ask what exactly you're looking for. Things that don't matter for that widget get ignored, and almost always some sane defaults are set. Syntax is : window is global variable of type sfg_window, and it contains table of tables called wigets, in which each table has type and some other vars. I'd say it's pretty intuitive and works ok for quick menus/guis that don't require critical speed.

54
SFML wiki / Physics Filesystem
« on: April 09, 2013, 06:56:56 am »
I've added example code of sf::InputStream that uses PhysicsFS to load from disc or some archive(it's all transparent and abstracted away by physics).
Can someone please double check formatting and that I didn't break the main Sources page or something?

https://github.com/SFML/SFML/wiki/Sources

https://github.com/SFML/SFML/wiki/Source%3A-PhysicsFS-Input-Stream

This will be helpful next time someone molests Laurent about SFML needing a filesystem.. :P

55
Network / Sending several times without receive
« on: March 29, 2013, 10:38:41 pm »
What happens if I send a few times via udp or tcp without receiving anything on the other end(not that the other end dropped out or such, just that sends pile up before I receive them)?
I assume it's ok but might reorder the udp packets?

56
SFML wiki / Shader Tile Map
« on: February 03, 2013, 12:11:39 am »
I've written and posted Shader Tile Map on the wiki, it has the glsl inlined within itself. It's idea is loosely based on Dbug's example from SFML Project forum, the vertex shader and idea of using too big textureRect is his, I've rewritten fragment shader from scratch. It wasn't tested very throughly. It's under MIT, I've sent Dbug message asking if he is ok with that, if he declines I'll change it and he said he is.

https://github.com/SFML/SFML/wiki/Sources
https://github.com/SFML/SFML/wiki/Source%3A-ShaderTileMap

57
Audio / sf::Musics' threads
« on: February 01, 2013, 06:05:00 pm »
Can few sf::Music instances play using single sf::InputStream?
If yes, does that require sf::InputStream implementation to be thread safe?

58
Graphics / Shader flips output
« on: January 06, 2013, 09:05:29 pm »
I only found one thread about that, which was made before 2.0, most others were related to rendertexture and display() on it.
Simply drawing a sprite with this shader, while I remove middle line, will flip the output.
uniform sampler2D my_texture;//sf::Shader::CurrentTexture
uniform vec2 my_tex_size;//it's size

void main()
{
        vec2 coords=gl_FragCoord.xy/my_tex_size;
        coords.y=1.0-coords.y;
        gl_FragColor=texture2D(my_texture,coords);
}
Is this expected to happen? I know SFML flips y for itself(right?). So does it mean I need to too to get same output?

59
Graphics / Order of drawing vertices in vertexarray
« on: December 06, 2012, 04:41:04 am »
Can there be any assumption about order of drawing primitives in vertexarray? For example 8 vertices, two quads, first one is big rectangle, other is smaller one with it's area completely contained in the area of first one. Will both always show, first in array getting drawn first or is it (implementation /un)defined?

60
Audio / Using data forsaken into .mp3 file
« on: December 05, 2012, 06:27:02 pm »
I was thinking of using some music that is in .mp3 file and using it in SFML but that requires freeing it from the patent prison of mp3 format which is where my question comes in:
What is the most resonable method of converting .mp3 into something useful for audio module while not making it weight a ton or lose a lot in terms of quality?

Pages: 1 2 3 [4] 5
anything