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

Pages: 1 ... 625 626 [627] 628 629 ... 719
9391
Graphics / Re: Cant draw Tilemap with Class
« on: October 22, 2012, 01:27:38 pm »
I though I knew that problem from somewhere (spieleprogrammierer)... ;D

The problem I think lies in the call sMap.setTexture(rMap.getTexture());, because you set a new texture but you don't change the size of the texture rectangle, so you actually don't cut out anything from the render texture. (I think Schorsch already tried to point you in that direction).
Try changing it to: sMap.setTexture(rMap.getTexture(), true);
Also you shouldn't return a copy of the sprite when calling drawMap() but instead use a const reference. ;)

9392
SFML projects / Re: SFMLUploads.org - Relaunch!
« on: October 22, 2012, 01:15:07 pm »
There was a problem with the SQL queries which lead to different problems, one was for instance that you could not create a new pastie.
Those bugs have now been resolved!


If you experience any problems, please report them here. It's impossible for me to test everything to its last detail and since the code wasn't originally written by me, I can't connect all the dots yet.
In near future I might rewrite most of it and adapt it to a better style which should also be easier to maintain. ;)

9393
Window / Re: Drawing/Displaying sprites from another function
« on: October 22, 2012, 09:27:24 am »
Like I said learn C++ first because you used a pointer and not a reference...

Also you should always separate logic & drawing and the drawing block should always be: clear, draw, display

9394
General discussions / Re: Dev-C++?
« on: October 22, 2012, 09:08:58 am »
If you want to use it at least use the most recent one from 2nd October 2012, you can grab it from here. ;)

9395
Graphics / Re: Transparent windows.
« on: October 22, 2012, 08:08:15 am »
A similar question has been asked not long ago. Maybe you find the discussion again...
SFML doesn't provide functionalities for transparent windows, but you might be able to get it with some OpenGL code.

9396
Graphics / Re: Where to put renderwindow
« on: October 22, 2012, 08:04:57 am »
I adivse you to read some more about OOP, because your current code doesn't make any sense... ;)

9397
General discussions / Re: Dev-C++?
« on: October 22, 2012, 08:01:53 am »
If you mean the original Dev-C++, then probably not...
But there's been some guy that took on the project and created a newer unoffical version, maybe someone uses it...

9398
Just read the official tutorials, it's all explained there... ::)

-l-lsfml-graphics
-lsfml-graphics

What could be the mistake here... :O

Also I strongly advise you against the use of SFML 1.6, it's over 2y old, contains quite a few nasty bugs and lacks a lot of new features.

9399
Window / Re: Drawing/Displaying sprites from another function
« on: October 21, 2012, 07:02:06 pm »
Is there any easy solution for this?  ???
Yes, learn C++ first. ;)
Seriously SFML is not a library with which one should learn very basic things like functions, classes, return types, types in general, references, etc. For those topics there exists hundreds of books and thousands of tutorials.
You also might want to read things about the object oriented programming (OOP) pattern.

To answer your question: Yes you can draw from different functions. You can for instance pass the render window as reference to the function and draw things from there. But if you want to make things a bit cleaner I'd use different classes to do so. ;)

9400
General / Re: What would be most efficient?
« on: October 21, 2012, 06:34:44 pm »
I wouldn't do one or the other... ;)
Instead I'd use a sf::VertexArray which will represent the whole tilemap, I then only render what is actually displayed on the screen and make use of sf::View for scrolling.

But I can't give you any more hints on that topic since I haven't implemented a tilemap on my own. ;)

9401
General / Re: How do i make my bitmap transparent? sfml2.0
« on: October 21, 2012, 02:23:48 pm »
It still exists, see here. ;)

The thing is that texture.loadFromFile() actually is simply a shorthand for loading it into an image and then copying it to a texture.

So what you have to do is load it into a sf::Image set the wanted transparent color and retrieve the texture.

Another option would be to mask the background color in a image editor and set it to transparent. ;)

9402
Window / Re: Black screen during fullscreen
« on: October 20, 2012, 09:30:56 pm »
And you're sure that it's not one thing in your functions that throw off things?
I don't really know something about OpenGL and I don't want to try to understand the code, but since the code is still quite big for a minimal & complete example, I guess it could be caused by some parts of your code.
Try to remove everything that's not necessary.

Also have you tried a 'normal' SFML example particularly the OpenGL example? Do they work fine in fullscreen mode?
Is your graphics driver uptodate?

9403
The one with two sprites will use a tiny bit more memory, where as the other just passes around references.
I don't think that one will have a better performance that the other, so you can use whatever fits better your code design. ;)

9404
Graphics / Re: sf::View and render target
« on: October 20, 2012, 01:25:30 pm »
I've written a tutorial of a way to look at sf::View and I tried to cover different use cases: Using sf::View

9405
C / Re: Change DLL path ?
« on: October 20, 2012, 01:21:12 pm »
http://stackoverflow.com/questions/327093/add-custom-dll-search-path-application-startup
As the above link suggests, set up delayed loading (thought I've tried with SFML DLL's unsuccessfully, however you might be able to get them to work) and on windows you can use SetDLLDirectory (or AddDLLDirectory, depending) to add the DLL path.
I strongly advise against such handling of DLLs, mostly because I this is very, very, very platform specific and one should always try to keep things as cross-platform as possible, specially when it comes to the building process. The purpose of code is to execute a task/game/etc. but it's definitely not its task to tell how things are linked (same argument against #pragma comment).

Also I think the suggested ways go way too far as for what the OP has asked... :-\

Pages: 1 ... 625 626 [627] 628 629 ... 719