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

Pages: 1 [2]
16
Graphics / sf::Texture.. "colliding" with sf::Text ?
« on: November 10, 2011, 11:54:23 am »
*Mind blown*
Oh, wow.
Thanks, Laurent!

17
Graphics / sf::Texture.. "colliding" with sf::Text ?
« on: November 10, 2011, 05:33:49 am »
I wouldn't really know how to post the code because there's just so much =/
But, somehow, when I display sf::Text on the RenderWindow, I have a texture applied to the texts (all of them) when I never did anything like that.
(I didn't even know you could apply textures to texts)

I've been trying to find the simplest way to replicate the issue but I can't =/
I do know that I use the following:
sf::Font
sf::Sprit
sf::Texture
sf::Text

Texture and Sprite are for the 'units' in my game while Font and Text are for little menus.

I don't see any direct interaction between the classes that would make it bug but it's happening to me.
Replicable in my project but not from scratch.

I'm using SFML2.0
I would upload the entire project but it's 70MB =/



[EDIT]
I moved the source files to a new project and zipped it up: http://a2step.com/ErrorProj.rar

It won't compile straight away as it needs the libs, dlls and header files for SFML2.0 to be configured for it.
Anyways, if you run it, go to NewGame->Easy, you will see the text bug with a texture applied on it =/

I wish I could replicate it in an easy way but I can't =/

18
Window / Focus on Window?
« on: November 07, 2011, 02:22:33 am »
Ahh..
Got it working now.
I just added this to the loop: App.PollEvent(sf::Event());
I used a temporary sf::Event because I don't need the Events for now.

Thanks.

19
Window / Focus on Window?
« on: November 07, 2011, 12:17:32 am »
I'm using SFML2.0 and VC++2010 and when I compile and run this:
Code: [Select]

int main () {
sf::RenderWindow App(sf::VideoMode(X_RATIO, Y_RATIO, 32), WINDOW_TITLE);
App.SetFramerateLimit(32);
while (true) {
App.Display();
}
return 0;
}

I can't seem to 'click' on the window it creates or move it about or do anything with it.
However, I can interact with the console window that opens up with it.

Am I missing something?

20
Graphics / dbgheap.c; bad pointer passed
« on: November 03, 2011, 12:20:07 am »
Huh..
That fixed it =x
Thanks, although I don't know what these CRTs are for =/

21
Graphics / dbgheap.c; bad pointer passed
« on: November 02, 2011, 08:32:10 pm »
I enabled the STATIC_STD_LIBS for CMake and it says "Multi-threaded DLL (/MD)"

22
Graphics / dbgheap.c; bad pointer passed
« on: November 02, 2011, 04:32:34 pm »
I'm really only doing what I've seen from the tutorials =x
Code: [Select]

//X_RATIO and Y_RATIO are 640 and 480 respectively
int main () {
//Set up the system
sf::RenderWindow App(sf::VideoMode(X_RATIO, Y_RATIO, 32), WINDOW_TITLE);
App.SetFramerateLimit(FPS);

sf::Vector2f center (X_RATIO/2, Y_RATIO/2);
sf::Vector2f half (X_RATIO, Y_RATIO);
sf::View View(center, half);

App.SetView(View);
//Other stuff
sf::Texture Texture;
if (! Texture.LoadFromFile("swapped.jpg")) {
App.Close();
}
sf::Sprite Sprite;
Sprite.SetTexture(Texture);
Sprite.Scale(X_RATIO/Texture.GetWidth(), Y_RATIO/Texture.GetHeight());

//Font/String Stuff
sf::Font Font;
if (! Font.LoadFromFile("04B_30_.TTF")) {
App.Close();
}
sf::Text Text("Hello, world!", Font);
//Main Loop
while (App.IsOpened()) {
if (sf::Keyboard::IsKeyPressed(sf::Keyboard::Escape)) {
App.Close();
}

App.Clear(sf::Color(0, 0, 0));

App.Draw(Sprite);
App.Draw(Text);
App.Display();
}

    return 0;
}

Quote

Windows has triggered a breakpoint in ItBotB.exe.

This may be due to a corruption of the heap, which indicates a bug in ItBotB.exe or any of the DLLs it has loaded.

This may also be due to the user pressing F12 while ItBotB.exe has focus.

The output window may have more diagnostic information.


Code: [Select]

> sfml-graphics-d-2.dll!_free_dbg_nolock(void * pUserData, int nBlockUse)  Line 1322 + 0x9 bytes C++
  sfml-graphics-d-2.dll!_free_dbg(void * pUserData, int nBlockUse)  Line 1265 + 0xd bytes C++
  sfml-graphics-d-2.dll!operator delete(void * pUserData)  Line 54 + 0x10 bytes C++
  sfml-graphics-d-2.dll!std::allocator<unsigned int>::deallocate(unsigned int * _Ptr, unsigned int __formal)  Line 182 + 0x9 bytes C++
  sfml-graphics-d-2.dll!std::basic_string<unsigned int,std::char_traits<unsigned int>,std::allocator<unsigned int> >::_Tidy(bool _Built, unsigned int _Newsize)  Line 1998 C++
  sfml-graphics-d-2.dll!std::basic_string<unsigned int,std::char_traits<unsigned int>,std::allocator<unsigned int> >::~basic_string<unsigned int,std::char_traits<unsigned int>,std::allocator<unsigned int> >()  Line 755 C++
  sfml-graphics-d-2.dll!sf::String::~String()  + 0x16 bytes C++
  sfml-graphics-d-2.dll!sf::Text::~Text()  + 0x54 bytes C++
  ItBotB.exe!main()  Line 59 + 0x1c bytes C++
  ItBotB.exe!__tmainCRTStartup()  Line 555 + 0x19 bytes C
  ItBotB.exe!mainCRTStartup()  Line 371 C


23
Graphics / dbgheap.c; bad pointer passed
« on: November 02, 2011, 04:05:00 pm »
I recently decided to stop using GLUT because it was just too restrictive =x
I looked around for alternatives and saw SFML recommended, so here I am.

Anyways, I was following the tutorials and reached the Fonts and Texts part when I hit a road block =/

The code I'm using is roughly:
Code: [Select]

sf::Font Font;
Font.LoadFromFile("04B_30_.TTF");
sf::Text Text("Hello, world!", Font);
while (true) {
Window.Draw(Text);
}


It works and all, the text is drawn onto the window but when I close the program, I get this error (from debugging):
Code: [Select]

         /*
         * If this ASSERT fails, a bad pointer has been passed in. It may be
         * totally bogus, or it may have been allocated from another heap.
         * The pointer MUST come from the 'local' heap.
         */
        _ASSERTE(_CrtIsValidHeapPointer(pUserData));

So some bad pointer is being passed or so it is claimed =/

I commented the line: sf::Text Text("Hello, world!", Font);
And the Drawing part and the error never came up.

I'm using SFML 2 (VS2010) and would like to know if I messed up or if it's just a little bug =x

Pages: 1 [2]
anything