Hi
I've started using SFML's Graphics to draw strings.
But when I added the strings code, my program consistently crashes when I closes it. So I attempted isolation and did a almost-vanilla program to run the draw strings code, and I still get crashes.
Here's the code:
#include <SFML/window.hpp>
#include <iostream>
#include <SFML/graphics.hpp>
using namespace std;
int main(void)
{
bool isRunning = true;
sf::String Text;
Text.SetText("Hello");
Text.SetFont(sf::Font::GetDefaultFont());
sf::RenderWindow App(sf::VideoMode(800, 600, 32), "Mozark System 0.1");
while (isRunning)
{
const sf::Input& Input = App.GetInput();
sf::Event Event;
while (App.GetEvent(Event))
{
//-- Process the various events
//Window Closed
if (Event.Type == sf::Event::Closed)
isRunning = false;
}
App.Display();
}
return EXIT_SUCCESS;
}
When I run Visual Studio's debug, and closed my program, I get:
Unhandled exception at 0x02360144 in Mozark.exe: 0xC0000005: Access violation reading location 0xfeeeff0e.
The IDE pointed me to void Image::DestroyTexture()'s
GLCheck(glDeleteTextures(1, &Texture)); <---
When I run the vanilla code as above, and closed it, I get:
Unhandled exception at 0x0249db10 in Mozark.exe: 0xC0000005: Access violation reading location 0xfeeeffb2.
The IDE pointed me to void WindowImpWin32::SetActive(Bool Active) const's wglMakeCurrent(NULL, NULL); <----
Library's bug or my coding is bad?
:/
Thanks for the help~ =)