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

Pages: 1 [2]
16
Graphics / Sprites only drawn once
« on: December 07, 2011, 03:01:41 am »
So it appears that that data is lost (apparently randomly)  when I convert an &sf::Sprite to an sf::Drawable*, when I changed it to just render sf::Sprite references it works fine, but when I convert to Drawable it only draws  the Sprite once.

17
Graphics / Sprites only drawn once
« on: December 06, 2011, 02:25:02 am »
I've stripped it down to only the object_map. I've also changed the sf::Drawable* argument to sf::Sprite. The error is still happening.

I am outputting the memory location of the image, then after I create the sprite and pass it to the Renderer I output the memory location of Sprite->GetImage();

The locations are matching for most entries but some will be 0, and I have no idea why. They are all inserted in the same manner.

Here is where the image/sprites are created (at line 30)
https://github.com/b3ngr33ni3r/Magnet/blob/master/OurGame/Main.cpp

Here is where they are added & drawn (line 120 and 92 respectively)
https://github.com/b3ngr33ni3r/Magnet/blob/master/OurGame/Renderer.cpp

18
Graphics / Sprites only drawn once
« on: December 05, 2011, 07:09:23 pm »
All the objects are accounted for in the renderer, 20 objects inserted, Window()->Draw() is called 20 times. The sprites aren't even white dots some just do not appear at all.

Running SFML 1.6 on GTX 560ti in debug mode.


Quote from: "Groogy"

On a side note: Your code is a bit hard to read because of the code convention your writing with and because of your love to overcomplicated solutions. My renderer that takes depth into account is much simpler. And it's even multi-threaded.


Was this really necessary? I'm glad your renderer is superior to mine, congratulations.

Edit:

Relevant Files:
https://github.com/b3ngr33ni3r/Magnet/blob/master/OurGame/Renderer.h
https://github.com/b3ngr33ni3r/Magnet/blob/master/OurGame/Renderer.cpp
https://github.com/b3ngr33ni3r/Magnet/blob/master/OurGame/ImageHandler.h
https://github.com/b3ngr33ni3r/Magnet/blob/master/OurGame/ImageHandler.cpp

19
Graphics / Sprites only drawn once
« on: December 05, 2011, 04:44:38 am »
I wrote a Render handler that draws a sf::Drawable* at certain depths. For some reason if a sprite using the same image as another sprite is in the handler only the first sprite inserted is drawn. Is there anything useful that is not common knowlegdge about sf::Image or sf::Sprite that would stop me from casting them as a Drawable that might cause this?

We have our project up at github, here is the Renderer cpp
https://github.com/b3ngr33ni3r/Magnet/blob/master/OurGame/Renderer.cpp

20
Graphics / RenderWindow.Clear() one sf::Shape?
« on: November 09, 2011, 09:49:04 pm »
Quote from: "Tex Killer"
The thing is: The rendered image is not layered, so if something is printed in front of another thing, that another thing gets replaced on those pixels. There is no coming back, as there is no changing history nor layers.

The best you can do is redraw only what was behind the removed image, but if there was something on top of it, will get replaced as well. And so on.

The simplier and more doable thing is to redraw everyting each frame, which is not very costly for something like 60 FPS, depending on the number of drawable instances. Everyone does just that.


ahh thank you

21
Graphics / RenderWindow.Clear() one sf::Shape?
« on: November 08, 2011, 11:33:50 pm »
So redrawing the whole frame is not taxing? Sorry, the scholar inside me dislikes the response "don't worry about that"

22
Graphics / RenderWindow.Clear() one sf::Shape?
« on: November 04, 2011, 08:16:55 pm »
Is it possible to remove a single DrawableObject from the render window rather than clear the whole thing every time? Seems inefficient in larger applications

23
Graphics / Hmm.
« on: October 16, 2011, 08:59:22 pm »
is there any chance you could just show a generic example of passing a RenderWindow, drawing to it, and then displaying it back in main?

even just passing it to a regular function (forget classes)

like:
Code: [Select]

int hi(RenderWindow App)
{
//draw to app
}

int main()
{
sf::RenderWindow App(sf::VideoMode(800, 600, 32), "Othello");
hi(App);
App.Display();
}



this would be appreciated, and im sure this more generic example would be much more beneficial to everyone.

24
Graphics / sf::RenderWindow::Draw() by reference
« on: October 16, 2011, 08:10:55 pm »
The drawing doesn't actually happen in the constructor, it happens in a member function. The member function is called in main.

25
Graphics / sf::RenderWindow::Draw() by reference
« on: October 16, 2011, 07:55:22 pm »
So I try to pass an sf::RenderWindow by reference to my class constructor. When I run sf::RenderWindow.Draw(myShape); i get no errors, but nothing appears in the render window.

Code: [Select]

class Board
{
    public:
        Board(sf::RenderWindow &App);
}

Board::Board(sf::RenderWindow &App)
{

    sf::Shape myShape= sf::Shape::Rectangle(0, 0,  100, 100, sf::Color(0, 0, 0));
    App.Draw(myShape);
}

//in main
sf::RenderWindow App(sf::VideoMode::GetMode(0), "Render Window");
Board gameBoard(App);


So how do can I draw to the renderwindow through reference like this?

26
General / Window Generation error with sfml 1.6 and visualStudio2010
« on: October 14, 2011, 07:33:19 pm »
Yea, I did that to no avail. I switched to Code blocks with mingw and it worked no problems, I'm so excited to finally be able to use SFML!

27
General / Window Generation error with sfml 1.6 and visualStudio2010
« on: October 14, 2011, 04:30:55 am »
when trying to run the following line, linking to the dynamic 1.6 library, after copying the correct dlls to the project directory, using visual studio 2010, the program compiles, then immediately crashes:
Code: [Select]
   sf::RenderWindow App(sf::VideoMode(800, 600, 32), "SFML Graphics");
i get (from the debugger in VC2010)
Code: [Select]

A buffer overrun has occurred in sfml.exe which has corrupted the program's internal state. Press Break to debug the program or Continue to terminate the program.

'sfml.exe': Loaded 'C:\Windows\SysWOW64\imm32.dll', Cannot find or open the PDB file
'sfml.exe': Loaded 'C:\Windows\SysWOW64\msctf.dll', Cannot find or open the PDB file
'sfml.exe': Loaded 'C:\Windows\SysWOW64\nvinit.dll', Cannot find or open the PDB file
'sfml.exe': Loaded 'C:\Program Files (x86)\NVIDIA Corporation\coprocmanager\detoured.dll', Cannot find or open the PDB file
'sfml.exe': Loaded 'C:\Program Files (x86)\NVIDIA Corporation\coprocmanager\Nvd3d9wrap.dll', Cannot find or open the PDB file
'sfml.exe': Loaded 'C:\Program Files (x86)\NVIDIA Corporation\coprocmanager\nvdxgiwrap.dll', Cannot find or open the PDB file
'sfml.exe': Loaded 'C:\Windows\SysWOW64\uxtheme.dll', Cannot find or open the PDB file
'sfml.exe': Loaded 'C:\Windows\SysWOW64\ig4icd32.dll', Cannot find or open the PDB file
The thread 'Win32 Thread' (0x200c) has exited with code 0 (0x0).



as near as i can tell all the vc++ and linker input things have been correctly configured, and it builds without a problem, as i previously said. however, still it immediately crashes.

Any help would be MUCH appreciated.[/code]

28
General / Latest GitHub Snapshot - Graphics example doesn't work
« on: October 14, 2011, 12:34:47 am »
Here are the libraries i link



Release type in cmake

29
General / Latest GitHub Snapshot - Graphics example doesn't work
« on: October 13, 2011, 10:55:02 pm »
static i beleive.

I changed the code:
Code: [Select]

1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall sf::RenderWindow::~RenderWindow(void)" (__imp_??1RenderWindow@sf@@UAE@XZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::RenderWindow::RenderWindow(class sf::VideoMode,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned long,struct sf::ContextSettings const &)" (__imp_??0RenderWindow@sf@@QAE@VVideoMode@1@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@KABUContextSettings@1@@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::VideoMode::VideoMode(unsigned int,unsigned int,unsigned int)" (__imp_??0VideoMode@sf@@QAE@III@Z) referenced in function _main
1>C:\Projects\SFML\sfml-test\Debug\sfml-test.exe : fatal error LNK1120: 3 unresolved externals

30
General / Latest GitHub Snapshot - Graphics example doesn't work
« on: October 13, 2011, 09:55:47 pm »
Hello all,

I recently downloaded and successfully built the latest version of SFML from github but when I try to run the example graphics program (from the tutorials) it fails with the following errors.

Code: [Select]

1>main.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall sf::RenderWindow::~RenderWindow(void)" (??1RenderWindow@sf@@UAE@XZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall sf::Window::Display(void)" (?Display@Window@sf@@QAEXXZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall sf::RenderTarget::Clear(class sf::Color const &)" (?Clear@RenderTarget@sf@@QAEXABVColor@2@@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall sf::Color::Color(unsigned char,unsigned char,unsigned char,unsigned char)" (??0Color@sf@@QAE@EEEE@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall sf::Window::Close(void)" (?Close@Window@sf@@QAEXXZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: bool __thiscall sf::Window::GetEvent(class sf::Event &)" (?GetEvent@Window@sf@@QAE_NAAVEvent@2@@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: bool __thiscall sf::Window::IsOpened(void)const " (?IsOpened@Window@sf@@QBE_NXZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall sf::RenderWindow::RenderWindow(class sf::VideoMode,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned long,struct sf::WindowSettings const &)" (??0RenderWindow@sf@@QAE@VVideoMode@1@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@KABUWindowSettings@1@@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall sf::VideoMode::VideoMode(unsigned int,unsigned int,unsigned int)" (??0VideoMode@sf@@QAE@III@Z) referenced in function _main
1>C:\Projects\SFML\sfml-test\Debug\sfml-test.exe : fatal error LNK1120: 9 unresolved externals


Can anyone help me?

(I'm using Visual Studio 10)

Pages: 1 [2]
anything