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.


Topics - ThreeDumps

Pages: [1]
1
DotNet / Crash on startup when using dock station.
« on: July 27, 2021, 12:14:58 am »
I use USB dock station with 2 monitors attached to it.

When I run app disconnected, it starts and run properly.
When I run app connected, it crash.
When I run app disconnected, then connect after app started, run properly.

internal class Program
{
    public static void Main(string[] args)
    {
         var window = new RenderWindow(new VideoMode(200,200), "test");
    }
}

Code: [Select]
Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at SFML.Graphics.RenderWindow.sfRenderWindow_createUnicode(VideoMode Mode, IntPtr Title, Styles Style, ContextSettings& Params)
   at SFML.Graphics.RenderWindow..ctor(VideoMode mode, String title, Styles style, ContextSettings settings)
   at SFML.Graphics.RenderWindow..ctor(VideoMode mode, String title)
   at Guids.Client.Program.Main(String[] args) in **[not important]**/Program.cs:line 10


2
Hello,

I would like to create a simple project which requires a couple of 3D features.

Basically I need:
1. 3D camera (orthographic)
2. 3D polygons
3. Heightmap

Should I try to adjust SFML? How hard it may be from your experience? Or maybe it would be better to go with pure OpenGL? I really like simplicity of SFML, maybe you know something similar for 3D with mentioned functionalities? 

3
Hello. I have managed class MainApp. Managed class can have only other managed types:
Quote
cannot define 'something' as a member of managed 'projekt_name': mixed types are not supported

I have other class (lets call it B) (this class have sf::RenderWindow) and it is normal C++ class. MainApp need to contain B. I can't have B in managed class so i have B* and in MainApp construtor i create new object for this pointer. In B i construct sf::RenderWindow by RenderWindow (WindowHandle handle), handle come from MainApp.

In B construktor I set setMouseCursorVisible( false ); and everything is ok so far.

But when I use display() or clear() evrything is going good but! When I close application i have
Quote
An unhandled exception of type 'System.AccessViolationException' occurred in project_name

I first destroy class B, and after that i destroy rest of controls in MainApp (when I change order effect is that same).

What prabobly I made wrong? It's banned to use sf::RenderWindow in object made by new?

4
Graphics / [SFML 2.0] Strange unhandled exception
« on: October 17, 2012, 12:24:55 pm »
Hello!

I have one problem.

#include <SFML/Graphics.hpp>

struct CFontd
{
    sf::Font * font;
    CFontd() {  
                font = new sf::Font();
                font->loadFromFile( "arial.ttf" );  
        }
} Font;

struct CFont
{
        sf::Text Text;
    CFont() {
                Text.setFont( *Font.font );
                Text.setString( "0" );
    }
};

int main() {
        CFont Test;
    sf::RenderWindow App( sf::VideoMode( 800, 600 ), "SFML works!" );
    while( App.isOpen() )
    {
        sf::Event ev;
        while( App.pollEvent( ev ) )
        {
            if( ev.type == sf::Event::Closed || ev.type == sf::Event::KeyPressed )
                 App.close();
           
        }
        App.display();
    }
    return 0;
}
 

All goes ok. But when I change implementation of CFontd class to

struct CFontd
{
    sf::Font font;
    CFontd() {  
        font.loadFromFile( "arial.ttf" );  
        }
} Font;

and of course
CFont() {
                Text.setFont( Font.font );
                Text.setString( "0" );
    }
I get unhandled exception after press any key (so i get ue when app closes).

So my question is: Why I can't use local "sf::Font" object in global objects?

5
Graphics / [SFML 2.0] How to change point color in RectangleShape?
« on: October 15, 2012, 04:56:03 pm »
I want to do health bar by using RectangleShape. In sfml 1.6 it was possible to change color for some points in Shape and receive a gradient effect instead color fill. It is possible with RectangleShape? I don't see appropriate function. So...

How to change chosen point color in RectangleShape?

6
General / Static linking, how? [Linux, 1.6]
« on: August 25, 2012, 05:22:14 am »
Hello!

I've problem. I've big mess in my head now.

I make projekt on linux and i want to static linking SFML 1.6. How to get in easiest way static libs?

I donwload from yours page SFML full SDK, and... ? I need to compile SFML? Or is way to make from *.so static lib *.a ?

//
ok, i compile SFML, and have *.a files.
I have linker errors, that comand is good ?
g++ -static main.o -L/home/akwes/libs/SFML-1.6/lib -lsfml-graphics-s -lsfml-window-s -lsfml-system-s
 

7
Graphics / How to save sf::Image with other than 72 ppi?
« on: April 30, 2012, 11:03:23 am »
Everything is in my question.

I can load *.png file with 300 ppi, but when i save it, i get file *.png with 72 ppi. It is option to change that ?

8
DotNet / Problem with install SFML.NET to C++/CLI
« on: October 05, 2011, 12:49:07 am »
VS 2008
SFML 1.6
I download "SFML.Net full SDK".
Normal SFML works fine in C++ projects but in C++/CLI i have linker errors.

1. I can`t find include folder in "dotnet" (but alredy have added includes form C++ SFML).
2. I add folder with libs form "dotnet"
3. I have no libs in "dotnet/lib" only *.dll-s, so i don`t know what write in Linker/Input
4. Add macro
5. Copy *.dll from "dotnet/lib" to project

And now have linker errors...

9
Graphics / Postfx - using, tutorials, galery ?
« on: September 12, 2011, 10:48:14 pm »
Hello!

I have a some questions. I would like to use postfx, but not quite know how.

What exactly i should to read? I will need to learn all OpenGL or something tutorials will be enough to write own effects?

Mayby is somewhere galery/colletion of ready postfx effects?

10
Graphics / Primitives, more points in polygon than are in code
« on: July 18, 2011, 04:04:57 pm »
I want to make efect like in WOW. When skill is not ready he has a black rect. Rect is disappears like clock. From 12:00 to 12:15 to 12:30, to 12:45, 12:00, but smoothly. I have something like this:

Code: [Select]

#include <iostream>
#include <conio.h>
#include <SFML/Graphics.hpp>

int main()
{
sf::RenderWindow oknoAplikacji( sf::VideoMode( 800, 600, 32 ), "Craftsman" );

// Left top point in rect
float x1 = 150;
float y1 = 50;

// Right down point in rect
float x2 = 650;
float y2 = 550;

// Coords of moving point
float ax = (x1+x2)/2;
float ay = y1;

// stopien - size of move for moving point
int stopien = 10;

// time - time from break to next step
int time = 0;

// how meny point will not draw
int point=0;

while(1)
{
oknoAplikacji.Clear( sf::Color( 255, 0, 0 ) );

sf::Shape Polygon;
Polygon.SetColor(sf::Color(0,0,0,100));


// When my moving point (ax, ay) is in one of nine points
// that point must be deletet (or not draw)
if      (ax == x2 && ay == y1)
point = 1;
else if (ax == x2 && ay == (y1+y2)/2)
point = 2;
else if (ax == x2 && ay == y2)
point = 3;
else if (ax == (x1+x2)/2 && ay == y2)
point = 4;
else if (ax == x1 && ay == y2)
point = 5;
else if (ax == x1 && ay == (y1+y2)/2)
point = 6;
else if (ax == x1 && ay == y1)
point = 7;
else if (ax == (x1+x2)/2 && ay == y1 && point == 7)
{
// starts from begin
ax = (x1+x2)/2;
ay = y1;
point = 0;
}

// behavior of moving point (when go left, when down etc.)
if (time >= 5)
{
if (point == 0)
{
ax+=stopien;
if (ax > x2)
ax = x2;
}
else if (point == 1)
{
ay+=stopien;
if (ay > (y2+y1)/2)
ay = (y2+y1)/2;
}
else if (point == 2)
{
ay+=stopien;
if (ay > y2)
ay = y2;
}
else if (point == 3)
{
ax-=stopien;

if (ax < (x2+x1)/2)
ax = (x2+x1)/2;
}
else if (point == 4)
{
ax-=stopien;
if (ax < x1)
ax = x1;
}
else if (point == 5)
{
ay-=stopien;
if (ay < (y2+y1)/2)
ay = (y2+y1)/2;
}
else if (point == 6)
{
ay-=stopien;
if (ay < y1)
ay = y1;
}
else if (point == 7)
{
ax+=stopien;
if (ax > (x2+x1)/2)
ax = (x2+x1)/2;
}
time = 0;
}

// Points of my Polygon

// my movin point to...
Polygon.AddPoint(ax,ay, sf::Color(0,0,0));


// ...next pionts (if exists)
if ( point <= 0 )
Polygon.AddPoint(x2,y1, sf::Color(0,0,0));
if ( point <= 1 )
Polygon.AddPoint(x2,(y1+y2)/2, sf::Color(0,0,0));
if ( point <= 2 )
Polygon.AddPoint(x2,y2, sf::Color(0,0,0));
if ( point <= 3 )
Polygon.AddPoint((x1+x2)/2,y2, sf::Color(0,0,0));
if ( point <= 4 )
Polygon.AddPoint(x1,y2, sf::Color(0,0,0));
if ( point <= 5 )
Polygon.AddPoint(x1,(y1+y2)/2, sf::Color(0,0,0));
if ( point <= 6 )
Polygon.AddPoint(x1,y1, sf::Color(0,0,0));

// always being, middle top point (we start from this point, and end hear)
Polygon.AddPoint((x1+x2)/2,y1, sf::Color(0,0,0));

    // middle of rect
Polygon.AddPoint((x1+x2)/2,(y1+y2)/2+70, sf::Color(0,0,0));

// for safety ( i don`t whant to have time biger than range int
if (time < 5)
time++;

oknoAplikacji.Draw(Polygon);

// drawing ALL POINTS OF POLYGON!
for (unsigned int i=0;i<Polygon.GetNbPoints();i++)
oknoAplikacji.Draw(sf::Shape::Circle(Polygon.GetPointPosition(i).x, Polygon.GetPointPosition(i).y, 5, sf::Color(255,255,255)));

oknoAplikacji.Display();
}
return 0;
}


But... WTF is this :

I draw all Points in my poly so why i have else?
Code: [Select]
for (unsigned int i=0;i<Polygon.GetNbPoints();i++)
oknoAplikacji.Draw(sf::Shape::Circle(Polygon.GetPointPosition(i).x, Polygon.GetPointPosition(i).y, 5, sf::Color(255,255,255)));

Pages: [1]
anything