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

Pages: [1]
1
System / Re: Error: Vector2 is not a template
« on: April 10, 2020, 01:12:16 pm »
Problem Solved, One of mine unfinished scripts made this error.

2
System / [SOLVED] Error: Vector2 is not a template
« on: April 09, 2020, 05:07:52 pm »


Error(s) is from file located in:
include\sfml\system\vector2.inl

I use:
Visual Studio Community 2017 15.9.21
SFML 2.5.1
ISO C++ 17 "Latest Draft Standard"
Release x64
SFML_STATIC

static library project
precompiled headers: disabled

Additional Dependencies:
(click to show/hide)

I tried (still the same error):
ISO C++ 14
Visual Studio Community 2017 15.9.19

VS Output:
(click to show/hide)

3
General / Re: _Pnode read access violation error in Text.setFont()
« on: August 15, 2018, 03:08:03 pm »
Don't use globals. SFML doesn't support having it's resources (ContextSettings, Font and Text in your case) as globals. It's also a bad design.
How Can I make this resources don't global? I tried something like that:
Quote
#include "stdafx.h"
#include <SFML\Graphics.hpp>
#include <SFML\Window.hpp>
#include "JQEText.h"


using namespace sf;
using namespace std;



map<int,string> numbers;
//numbers["count"] = 6;
   int main()
   {
#pragma region Start

      ContextSettings settings;

      Font font;

      settings.antialiasingLevel = 8;
      RenderWindow engine{ VideoMode{ 1920,1000 }, "JQEngine",0,settings };
      engine.setFramerateLimit(60);
      Event event;
      engine.setPosition(Vector2i(0,0));
      font.loadFromFile("Arkitech.ttf");
      JQEText text = JQEText(25, font, "test", Vector2f(0, 0), Color(255, 255, 255));
      
      

      
      //mousePosition.setColor(Color(0, 0, 0, 255));

      
#pragma endregion
      
      
      //rest of code
   }
And I still got this error

4
General / _Pnode read access violation error in Text.setFont()
« on: August 15, 2018, 01:04:31 pm »
Hello! I've got every time error when I trying in my class  set font to Text.
Full error:" Exception thrown: read access violation.
**_Pnode** was 0xFFFFFFFFFFFFFFE6."
Full script with main()
Quote
#include "stdafx.h"
#include <SFML\Graphics.hpp>
#include <SFML\Window.hpp>
#include "JQEText.h"


using namespace sf;
using namespace std;

ContextSettings settings;

Font font;
Text test;
map<int,string> numbers;
//numbers["count"] = 6;
   int main()
   {
#pragma region Start



      settings.antialiasingLevel = 8;
      RenderWindow engine{ VideoMode{ 1920,1000 }, "JQEngine",0,settings };
      engine.setFramerateLimit(60);
      Event event;
      engine.setPosition(Vector2i(0,0));
      font.loadFromFile("Arkitech.ttf");
      JQEText text = JQEText(25, font, "test", Vector2f(0, 0), Color(255, 255, 255));
      
      

      
      //mousePosition.setColor(Color(0, 0, 0, 255));

      
#pragma endregion
      
      
      while (true)
      {
         
         
         engine.clear(Color(255 * 0.4, 255 * 0.4, 255*0.4, 255));
         engine.pollEvent(event);
         if (event.type == Event::Closed)
         {
            engine.close();
            break;
         }
         else if (event.type == Event::MouseButtonPressed)
         {

            //Mouse::getPosition(engine).x Mouse::getPosition(engine).y;
            
         }
         
         
         
         engine.draw(test);
         engine.draw(text);
         engine.display();
         
      }
      return 0;
   }
Full class.h
Quote
#pragma once
#include "stdafx.h"
#include <iostream>
#include <fstream>
#include <SFML\Graphics.hpp>
#include <SFML\Window.hpp>
#include <cstdlib>
#include <ctime>
#include <string>
#include <Windows.h>

using namespace sf;
using namespace std;

class JQEText : public Drawable
{
public:
   JQEText(int size, Font font, string ttext, Vector2f position, Color color);
   ~JQEText();
   Text text;
private:

   void draw(RenderTarget& target, RenderStates state) const override;
};
Full class.cpp
Quote
#include "stdafx.h"
#include "JQText.h"


JQText::JQText(int size, Font font, string ttext, Vector2f position, Color color)
{
   text.setCharacterSize(size);
   text.setFont(font); // when I added "//" before that command I don't get this error
   text.setString(ttext);
   text.setPosition(position);
   text.setFillColor(color);
}


JQText::~JQText()
{
}
void JQText::draw(RenderTarget& target, RenderStates state) const
{
   target.draw(text, state);
}


5
SFML website / Re: unresolved external symbol
« on: June 09, 2018, 03:17:23 pm »
I saw topics like that topic, but they don't help me with my actual error.
Does that mean your version of Visual Studio is at least 15.7.0?
No, thanks. Now that working

6
SFML website / unresolved external symbol
« on: June 09, 2018, 12:57:48 pm »
Hello, I saw topics like that topic, but they don't help me with my actual error.
code:
(click to show/hide)
error:
(click to show/hide)
libraries what I add to Linker->Input->Additional Dependencies:
(click to show/hide)
(I use x64)

Pages: [1]
anything