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

Pages: [1] 2 3 4
General / Re: sf::priv and Linker Problems
« on: December 07, 2013, 02:21:27 pm »
Do you work with actual 3D textures (which have 3 dimensions) or should it be capable of projecting 3D scenes onto a texture? Because otherwise, the render texture implementation will probably not differ that much from 2D...
Projecting 3D scenes onto it. And yes the implementation barely differs from the original. I have a working RenderTarget3 and respectively RenderWindow3 that draws 3d without a problem and RenderTexture3 inherits from RenderTarget3.

What are the design goals of your 3D library? Should it extend an un-changed SFML or do you plan to modify SFML itself in order to incorporate new functionality? Will you have a separate library or just a modded SFML?
Just a generic kind of 3D engine. I don't plan to modify the sound/window/networking parts in hopes of keeping it cross platform, but I've already modified some of the sfml graphics source code and will do so further if needed.

Do I need to modify some source code and recompile the dlls to fix this problem then?  ???

General / Re: sf::priv and Linker Problems
« on: December 06, 2013, 05:06:14 pm »
So is there any way to make it work without breaking everything?
I'm really not experienced at working with dlls  :-\

General / sf::priv and Linker Problems
« on: December 05, 2013, 04:09:56 pm »
I'm making a 3d engine on top of SFML so I have to basically remake SFML/Graphic in 3D.
This takes for the most part a lot of copy pasting of original SFML code and making some little changes to it.
I've made a RenderTexture3 (3 for 3D  :P) class and everything compiles just right but I get some linker error on the Texture implementations that are in sf::priv namespace:
error LNK2019: unresolved external symbol "public: __thiscall
sf::priv::RenderTextureImplFBO::RenderTextureImplFBO(void)" (??
0RenderTextureImplFBO@priv@sf@@QAE@XZ) referenced in function "public: bool __thiscall
RenderTexture3::create(unsigned int,unsigned int,bool)" (?create@RenderTexture3@@QAE_NII_N@Z)

error LNK2019: unresolved external symbol "public: static bool __cdecl
sf::priv::RenderTextureImplFBO::isAvailable(void)" (?isAvailable@RenderTextureImplFBO@priv@sf@@SA_NXZ)
 referenced in function "public: bool __thiscall RenderTexture3::create(unsigned int,unsigned int,bool)" (?

error LNK2019: unresolved external symbol "public: __thiscall
sf::priv::RenderTextureImplDefault::RenderTextureImplDefault(void)" (??
0RenderTextureImplDefault@priv@sf@@QAE@XZ) referenced in function "public: bool __thiscall
RenderTexture3::create(unsigned int,unsigned int,bool)" (?create@RenderTexture3@@QAE_NII_N@Z)

And the responsible code part (basically the same as in sf::RenderTexture)
        // Create the implementation
        delete impl_;
        if (sf::priv::RenderTextureImplFBO::isAvailable())
                // Use frame-buffer object (FBO)
                impl_ = new sf::priv::RenderTextureImplFBO();
                // Use default implementation
                impl_ = new sf::priv::RenderTextureImplDefault();

        // Initialize the render texture
        if (!impl_->create(width, height, tex_.m_texture, depthBuffer))
                return false;

I've asked Laurent quite long ago about a similar problem with glcheck.
He told me to make a new class for that and I did.
This time I don't want to make a new class, mostly because I will have to recreate a whole group of classes and update them myself later, which goes against my goal of basing my engine on SFML and only updating the relevant parts.

I hope someone here can help me ;)

SFML projects / Re: Real-time Path Tracer
« on: June 05, 2013, 07:05:33 pm »
This looks great! :D
Need to make one of my own once I have some free time.

Graphics / Re: ViewPort not working correctly?
« on: May 11, 2013, 08:39:13 pm »
What gostron said + the view is in the wrong position as far as I can see.
Add this after you create the view:
miniMap.setCenter(imageWidth/2, imageHeight/2);
or even better intialize the view like this:
sf::View miniMap(mBGTexture.getSize()/2,mBGTexture.getSize())

Graphics / Re: Making 3D SFML
« on: May 11, 2013, 03:19:32 pm »
Well this is weird... I'm not getting any errors/warnings at all.
Besides using multiple glewInit() should just redefine all the bools and function pointers.
The warnings you get are due to export and then reimport of GLEW "symbols" :
Quote from: "msdn"
This warning is generated by the linker when you declare a symbol by using the __declspec(dllexport) storage-class attribute in one object file and reference it by using the __declspec(dllimport) attribute in another.]

It's a private implementation detail, so... forget it, do your own stuff ;)
I don't really understand the point of making functions in glCheck private...
They're pretty simple and are just for error checking anyway :\

Now, ensureGLcontext is another thing :)
It's pretty damn complicated...
setActive is there to make SFML thread safe, istn it?  ???

glewInit() did the trick and it seems that everything is working fine :D
Thanks again Laurent!

BTW can I use GLresource for Vertex/Pixel buffer implementations?
It's basically a thread-safe counter for the openGL resources if I understand everything right.

Graphics / Re: Making 3D SFML
« on: May 09, 2013, 10:00:24 pm »
By removing the ensureGlewInit and by commenting out some openGL ARB functions I managed to get it working.
It's something I guess :P

What should I do with ensureGlewInit then? Try making my own? Is it even needed?
(During debugging I noticed that it's called like 4 or 5 times every time you draw something O.O)

And how can I get those ext ARB functions to work?
(I get a bad memory acces crash when it tries to use glBlendEquation or glUseProgramObjectARB)

BTW thanks Laurent! You're a goddamn wizard as always :D

Graphics / Re: Making 3D SFML
« on: May 09, 2013, 05:07:34 pm »
That took care of errors 3-7, but error 2 (sf::priv::ensureGlewInit()) still pops up :(

Graphics / Making 3D SFML
« on: May 09, 2013, 04:38:29 pm »
Over the last month or so I have been trying to make a 3D SFML-like thing (with SFML as the base).

Today I ran into a problem with GLEW while making a 3D version of RenderTarget. I'm not sure which libraries to link/ not link.
Currently I'm only linking the extlibs/libs-msvc/glew.lib (and the standard sfml libs), but it still gives linker errors:

Error   2       error LNK2019: unresolved external symbol "void __cdecl sf::priv::ensureGlewInit(void)" (?ensureGlewInit@priv@sf@@YAXXZ) referenced in function "public: void __thiscall RenderTarget3::resetGLStates(void)" (?resetGLStates@RenderTarget3@@QAEXXZ)     C:\Users\SVS\documents\visual studio 11\Projects\Project1\Project1\RenderTarget3.obj    Project1

Error   3       error LNK2001: unresolved external symbol __imp____glewBlendEquation    C:\Users\SVS\documents\visual studio 11\Projects\Project1\Project1\RenderTarget3.obj    Project1

Error   4       error LNK2001: unresolved external symbol __imp____glewUseProgramObjectARB      C:\Users\SVS\documents\visual studio 11\Projects\Project1\Project1\RenderTarget3.obj    Project1

Error   5       error LNK2001: unresolved external symbol __imp____glewBlendFuncSeparateEXT     C:\Users\SVS\documents\visual studio 11\Projects\Project1\Project1\RenderTarget3.obj    Project1

Error   6       error LNK2001: unresolved external symbol __imp____GLEW_EXT_blend_func_separate C:\Users\SVS\documents\visual studio 11\Projects\Project1\Project1\RenderTarget3.obj    Project1

Error   7       error LNK1120: 5 unresolved externals   C:\Users\SVS\documents\visual studio 11\Projects\Project1\Debug\Project1.exe    Project1
Any help would be very appreciated :)

Graphics / Re: Click on a sprite
« on: April 18, 2013, 11:32:16 am »
Actually it was literally the very first result, that's why I got a bit ticked off.
Maybe my Google settings are different... >_>
The first result for me is this: http://en.sfml-dev.org/forums/index.php?topic=5662.0
And what you get from it is this:
Code: [Select]
bool isSpriteClicked ( sf::Sprite *spr, sf::RenderWindow *render )
const sf::Input& Input = render->GetInput();
if( Input.GetMouseX() > spr->GetPosition().x
&& Input.GetMouseX() < spr->GetPosition().x + spr->GetSize().x
&& Input.GetMouseY() > spr->GetPosition().y && Input.GetMouseY() < spr->GetPosition().y + spr->GetSize().y
&& Input.IsMouseButtonDown(sf::Mouse::Left)
return true;
return false;

Code: [Select]
if(isSpriteClicked( &YOUR_SPRITE, &Window ))
// Example:

It should work correctly with SFML 1.6 and VS 2008/2010

I helped you. But i see that you dont have any idea on game prgramming ;). At first you must know C++ better and Do some console games (CLI). Text based. Dont try make 2d/3d games right now! Learn at first!

As Nexus mentioned, this topic was grinded over many times before, there is no point in doing it once more, just because someone is too lazy to spend around 10 seconds to search for the old topic.

BTW, synok the last few sentence in the quote above apply to you too.
Do some tutorials or read some books on game development, before you start programming.


He should learn to do it without all this fancy stuff, otherwise it is useless.
I mean AABB collisions are one of the very first things you learn, seriously =_="

Hehe, let's make it even shorter  :P :
    if (sprite.getGlobalBounds().contains(window.mapPixelToCoords(sf::Mouse::getPosition(window))))
        // mouse is on sprite!

Graphics / Re: Click on a sprite
« on: April 16, 2013, 06:35:05 pm »
I tried searching, but did not find anything relevant.

Blatant lies =_="

SFML projects / Re: dxSFML
« on: March 12, 2013, 12:33:15 pm »
I think that the best solution is to use ANGLE

Just read a bit up on ANGLE and WOW. Do it.
I think one of the main things  why people don't choose SFML for their games is due to it not supporting directX
(mostly because it is said that directX has better driver support and runs better on windows).
And having SFML for Android would be just plain awesome! :D

On the side-note: would it be possible to use latest directX stuff with Angle?
Maybe DirectX.hpp for SFML (just like OpenGL.hpp)?

SFML projects / Re: New RichText class
« on: March 04, 2013, 06:52:57 pm »
If the markup were to use BBcode you would end up with something like this:

string1 "[color=orange]Inserted String[/color]" +
string2 "[color=green]Original String Start ... End[/color]" =
endString "[color=green]Original String Start [color=orange]Inserted String[/color] End[/color]"

Theoretically I could manage color state with a stack, but nesting tags like that makes me skittish . Parsing BBcode would be a lot more complicated than what I'm doing now, too.

You'd still need to escape characters; they would just be a different set. '[' and ']' would have to be escaped, at least.
Well how about #color and /# then? ;)
I mean, what's so difficult about a stack?
(You'll need only one for colors; bold, italics and underline can be kept as bools).

On that note, what type of subset are you thinking of? Supporting multiple fonts and character sizes could be tricky. A simple test document I just made includes references to Times New Roman, Arial and Mangal, and I'm only using Times.
Well you're using separate Texts already, so why would it be difficult?
Something like & for size and @ for Font should work.
Sizes should work just like everything else but you'll need a map for Fonts.
If you want to batch the Texts by Font and Size you could, again use a map or some sorting algorithm.

SFML projects / Re: AW: Re: New RichText class
« on: March 04, 2013, 03:13:42 pm »
No SFML  doesn't do any batching. One can reduce the draw calls by using vertex arrays.
Hmmm I guess draw calls aren't that evil then  ???

Probably because the only use case for it would be a part of an existing HTML page that should be drawn with SFML. However, parsing only colors and formattings, one is still too limited to actually display even a simple HTML page. Additionally, websites usually define the layout in the CSS, not HTML document.

Using HTML tags voluntarily for graphical applications doesn't make any sense -- the syntax is extremely verbose (you always need two tags for each formatting, and each tag consists of many characters). In contrast, the compact syntax proposed by TechRogue is very handy, as it still leaves the text readable.

Oh, by all means, I never actually meant implementing the HTML parsing/drawing. Even doing it partially would be quite hard (let's just leave that stuff to the guys at Google and Mozilla ;) ).
And I do agree that the characters TechRogue chose are quite damn good (not often used and do kind of hint  to what they're supposed to do, like the underscore for the underlining).
What I meant is to have the opening/closing tags, since, well, they just work.
Especially in situations when you're inserting for example a sting into another like so:
string1 "#orange Inserted String" +
string2 "#green Original String Start ... End" =
endString "#green Original String Start #orange Inserted String End"
As you can see the "End" stays orange colored. This could be very easily avoided by using the closing tags.

Also the BB-like syntax with "[]" would prevent the need for escaping characters.

Very bad idea. If you want this class to be used by other people, you cannot just modify SFML. No one will download your fork only for such a class, all the more if he cannot be sure what other code you broke with your "hacks".

Just use the abstraction mechanism SFML provides, and trust in Laurent to have spent some time on how to make rendering fast. You won't simply outperform SFML in a few minutes, especially not without violiating other design decisions. Concretely, this case amounts to sf::VertexArray.

I do agree on this point. Hacking stuff in programming is generally bad. But it works.
I tried "hacking" the Text class to enable a bitmap font, using memcpy and so on. It was extremely ugly. But it worked. :P
As for being used by other people, that's not really an issue for me.
I think I'll require a special Text class for my GUI system anyway, so it will be useless for other people.
But if it can be profitable for everyone, why not?

I believe SFML 2.x uses vertex arrays to do text drawing anyway. Granted, drawing each chunk of text separately (as my class does) negates some of the benefit, but it should still be quite fast.
Using a single vertex array would be quite simple, but you need to copy and modify the source code of sf::Text.

This would be quite nice :)
Especially if it would be added to SFML afterwards.

But what about using multiple fonts in one vertexArray?

SFML projects / Re: New RichText class
« on: March 03, 2013, 07:46:01 pm »
It constantly makes me wonder, why doesn't anyone make a Richtext format with BB/HTML-like code support.
It shouldn't be hard (maybe, once I overcome my laziness I'll do it myself :P ).

Job well done nonetheless.

BTW does anyone know if there's some sort of draw call batching behind SFML code?
I've done some tests with draw calls and didn't see much of a difference.
And looking through the SFML source didn't reveal anything either.
Draw calls should be expensive right? ???
I would try hacking the SFML Font and Text to be able to draw everything in one call and maybe enable bitmap-fonts.

Pages: [1] 2 3 4