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 - Me-Myself-And-I

Pages: [1] 2
1
Graphics / (solved)invisible window border causes smaller top of window
« on: February 04, 2024, 08:40:27 pm »
I have a program that gets the desktops workarea size then makes a window with that size and it works good for displaying the window as large as the screen and not cover up the taskbar but either this or sfml's window class is causing a transparent border to shrink the window at the top.

Here's my code:



IntRect getWorkArea()
{
        RECT rcWorkArea = { 0 };
        SystemParametersInfo( SPI_GETWORKAREA, 0, &rcWorkArea, 0 );
        return IntRect(int(rcWorkArea.left),int(rcWorkArea.top),int(rcWorkArea.right),int(rcWorkArea.bottom));
}


int main()
{
        IntRect workarea;
        workarea=getWorkArea();
        RenderWindow window(VideoMode(workarea.width,workarea.height),"Blupi Desktop",Style::None);
       
       //loop stuff
}
 

2
Hello all.

I know I have asked about this before but I still haven't found a solution. My biggest problem is trying to load dimentionally large animations into a game without causing performance lagging or having an overabundance of texture objects. If I put any large dimention animations into a spritesheet its too large to load to texture. Recently I heard something about it being possible to load large textures using vertices. Is this correct? If so, How? My game isn't so dimentionally large.Its only 960x540 at most. There must be a way to display large frames without hitting performance issues. If I split up an animation thats large into dimentionally small frame rects and save each as files,and load each into the game,it still requires either loading a lot into memory or lloading from file as its needed. Loading from file as needed definitely causes lag I know.  Would it be possible to create several textures when they are needed for preloading and delete them after its done playing the animation?Or would this still cause lag?Also I know that each texture is loaded into memory anyways so why can't it treat one large image as memory the same way that it treats several loaded images as the same amount of memory?

3
Graphics / Image doesn't save but gives no error report.
« on: November 16, 2023, 05:21:37 am »
I searched and searched for an existing topic about this problem because I think I made a similar topic previously. I just couldn't find it.
 
I keep running into this problem every time I make a program that is manipulating images.
Eventually the image does not save as a file and no error report shows up. I just can't figure why it doesn't save. Previous attempts have shown extreme flippancy by influence of non related changes that only sometimes fix it every other time it runs. With this specific program I'm not experiencing any flippancies yet.



string sframe[100];
int numberOfFrames;
RectangleShape shape;
Crop::loadcrop(string filetype)
{
       
        ifstream framelist("frames/frame list.txt");
        for(int a=0;a<100;a++)
        {
                getline (framelist,sframe[a]);
               
                if(sframe[a]=="")
                {
                        numberOfFrames=a-1;
                        break;
                }
                sframe[a]+=filetype;
        }
       
        shape.setOutlineColor(Color::Red);
        shape.setFillColor(Color::Transparent);
        shape.setOutlineThickness(2.f);
        shape.setSize(Vector2f(0,0));
}

int  currentframe=0;
Texture texture;
Sprite sprite;
IntRect rect[100];
IntRect selectrect;
bool firstclick=false; 
bool firsttap=false;   
Crop::setcrop(RenderWindow &window)
{
        if(currentframe<numberOfFrames)
        {
                texture.loadFromFile("frames/"+sframe[currentframe]);
                sprite.setTexture(texture);

                Vector2f MPosition=window.mapPixelToCoords(Mouse::getPosition(window));
               
                if(Mouse::isButtonPressed(Mouse::Left))
                {
                        shape.setPosition(MPosition.x,MPosition.y);
                       
                }
                if(Keyboard::isKeyPressed(Keyboard::Space))
                {
                        shape.setPosition(MPosition.x-shape.getSize().x,MPosition.y-shape.getSize().y);
                }
                shape.setSize(Vector2f(MPosition.x-shape.getPosition().x,MPosition.y-shape.getPosition().y));
                selectrect=IntRect(shape.getPosition().x,shape.getPosition().y,shape.getSize().x,shape.getSize().y);
                if(Keyboard::isKeyPressed(Keyboard::Return))
                {
                        if(firsttap==false)
                        {
                               
                                currentframe++;
                                firsttap=true;
                                rect[currentframe]=selectrect; 
                       
                        }
                }
                else
                {
                        firsttap=false;
                }
               
        window.draw(sprite);
        window.draw(shape);    
        }
        else
        {
                save();
                window.close();
        }
       
}





Crop::save()
{
        Image image[numberOfFrames];
        Vector2i totalsize;


        for(int x=1;x<numberOfFrames+1;x++)
        {
               
                image[x].loadFromFile("frames/"+sframe[x]);
               
               
        }
       
       
       
       
        Image saveimage;

        Vector2i currentsize;
        bool row=true;
        Vector2i sizecheck;
        for(int x=0;x<numberOfFrames;x++)
        {
                if(totalsize.x<1000)
                {
                        totalsize.x+=rect[x].width;
                }
               
                if(sizecheck.x<1000)
                {
                        sizecheck.x+=rect[x].width;
                }
                else
                {
                       
                        totalsize.y+=rect[x].height;
                        sizecheck.x=0; 
                }
               
        }

        saveimage.create(totalsize.x,totalsize.y,Color::Transparent);
       

        for(int x=0;x<numberOfFrames;x++)
        {      
               
                currentsize.x+=rect[x].width;
               

       
                if(currentsize.x<=totalsize.x)
                {
                        //
                        for(int x1=currentsize.x-rect[x].width;x1<currentsize.x;x1++)
                        {
                                for(int y=currentsize.y-rect[x].height;y<currentsize.y;y++)
                                {
                                        saveimage.setPixel(x1,y,image[x].getPixel(x1-currentsize.x,y-currentsize.y));
                                }
                        }      
                }
                else
                {
                        currentsize.y+=rect[x].height;
                        currentsize.x=0;
                }
        }
 
        saveimage.saveToFile("test/sheet.png");
        //WHY DO I KEEP RUNNING INTO THIS PROBLEM WHERE IMAGES DONT SAVE AND SHOW NO ERROR?!
       
}

Ok.So my code is extremely confusing to anyone not familiar with my terms but i'm absolutely certain that the save() function is where the problem is. And it is certain that the images are loaded  into 
Image image[numberOfFrames];
without any problems since these images have been saved as separate files before I tried combining them into one image.The important thing is getting the image called "saveimage" to save to file.

Any ideas what wrong here?

4
Window / ffplay causes sfml window to freeze and crash.
« on: October 19, 2023, 03:11:54 pm »
Just  like the title says"ffplay causes sfml window to freeze and crash".Any ideas how to bypass or fix this problem?

5
Audio / Playing sound causes frame or line skips.
« on: October 15, 2023, 03:58:39 am »
I'm having a problem with a function I made and I was wondering if anyone could help me figure out the problem.I have a file called playsound.h,and a .cpp file for that. When the function runs,a sound plays as wanted but it causes a problem. I'm not sure if it causes a lag or a line skip,or a frame skip or what.All I know is that it causes image skips and it causes the program to get its variables all messed up so I assume it has something to do with skipping some code. So the question is" Why does it do this?".


playsound.h

#pragma once
#include <SFML\Graphics.hpp>
#include <SFML/Audio.hpp>
using namespace sf;
#include <string>
using namespace std;


extern Sound channel[50];
extern SoundBuffer noise[50];
extern string lastsound[50];
void playsound(int channelnumber,string soundDirectory);



playsound.cpp

#include <SFML\Audio.hpp>
using namespace sf;
#include "playsound.h"
#include <string>
using namespace std;

Sound channel[50];
SoundBuffer noise[50];
string lastsound[50];

void playsound(int channelnumber,string soundDirectory)
{

        if(soundDirectory!=lastsound[channelnumber])
        {
                noise[channelnumber].loadFromFile(soundDirectory);
                channel[channelnumber].setBuffer(noise[channelnumber]);

                if(channel[channelnumber].getStatus()!=Sound::Playing)
                {
                        channel[channelnumber].play();
                        lastsound[channelnumber]=soundDirectory;
                }
        }
        if(channel[channelnumber].getStatus()!=Sound::Playing)
        {
                lastsound[channelnumber]="";
        }
}

 


6
General / drawing Text array to screen crashes window.
« on: August 26, 2023, 02:39:42 am »
I'm trying to learn to use sfml's networking to make a chat program.I got this to work in console so I decided to do it with a window and Text. I was planning on having an array of Text that displays the received messages. This is called "mess".Drawing the array to screen using a for loop results in the window crashing.This however doesn't happen for the first index of mess. I tried limiting the for loop to just 0 but this still results in a crash.by the way,the typing input does draw to screen with no problem.

#include <iostream>
#include <SFML\Network.hpp>
#include "main.h"
using namespace std;
#include <SFML\Graphics.hpp>
using namespace sf;






RenderWindow window(VideoMode(960,540),"");


int main()
{
       
       
        int currentline;
        Font font;
        font.loadFromFile("C:\\Windows\\Fonts\\comic.ttf");
        Text typing;
        Text mess[4000];
        for(int x=0;x<4000;x++)
        {
                mess[x].setFont(font);
                mess[x].setCharacterSize(24);
                mess[x].setFillColor(Color::Blue);
        }
        typing.setFont(font);
       
        typing.setCharacterSize(24);
        typing.setFillColor(Color::Blue);

       
        Clock clock;
       
       
       
       
       
       
       
        IpAddress ip=IpAddress::getLocalAddress();
        string text="Connected to:";
        char buffer[2000];
        size_t received;
       
        TcpSocket socket;
        char connectiontype,mode;
        cout<<"Enter(s) for server,Enter (c) for client.\n";
        cin>>connectiontype;

        if(connectiontype==&#39;s&#39;)
        {
                TcpListener listener;
                listener.listen(5300);
                listener.accept(socket);
                text+="Server";
               
               
        }
        else if(connectiontype==&#39;c&#39;)
        {
                socket.connect(ip,5300);
                text +="Client";
                       
        }
        mess[0].setString(text);
        string input;
        while(window.isOpen())
        {
               
               
                        if(Keyboard::isKeyPressed(Keyboard::Return))
                        {
                                string typed=typing.getString();
                                socket.send(&#39;~&#39;+typed.c_str(),typed.length()+1);       
                                typing.setString("");
                                input="";
                        }
                       
                        socket.receive(buffer,sizeof(buffer),received);
                       
                if(buffer[0]==&#39;~&#39;)     
                {
                        mess[currentline].setString(string(buffer));
                        buffer[0]=&#39;&#39;;
                        currentline++;
                }
               
               
               
                Event e;
               
                while(window.pollEvent(e))
                {
                        if(e.type==Event::Closed)
                                window.close();
               
               
               
                        if(e.type==Event::TextEntered)
                        {
                                input+=e.text.unicode;
                               
                                typing.setString(input);
                        }
                }
               
               
               
               
               
                window.clear(Color::Cyan);
               
                window.draw(mess[0]);
                //window.draw(mess[1]);
                for(int x=0;x<currentline;x++)
                {
                        mess[x].setPosition(0,mess[x].getCharacterSize()*currentline);
                        window.draw(mess[x]);
                }
                typing.setPosition(0,mess[0].getCharacterSize()*(currentline+1));      
                window.draw(typing);
               
                window.display();
        }
        return 0;
       
}      

7
I can't get a program to run from executable when it uses sfml.It doesn't run without being in the IDE.Running the program from exe gives this kind of error.
---------------------------
Project2.exe - System Error
---------------------------
The program can't start because libgcc_s_sjlj-1.dll is missing from your computer. Try reinstalling the program to fix this problem.
---------------------------
OK   
---------------------------

I find that adding the missing file does bypass this particular error but then something else related to gcc is missing.
I'm using Devc++ 5.11,SFML 2.4.2,and GCC 4.9.2.

My directory settings are:
C:\SFML-2.4.2\lib //for libraries
C:\SFML-2.4.2\include //for includes
//both are accurate.

My Linker settings are:
-lsfml-audio
-lsfml-graphics
-lsfml-system
-lsfml-window

I'm using windows 7 but I have also tried this with the same properties on windows 10 too.
Does anyone see what's wrong here? I could sure use a clue.

8
General / A problem with platformer side collisions.
« on: July 12, 2023, 07:15:26 pm »
Hello.I'm having some trouble getting the collisions correct for a platformer.I have tried many different ways but have had none success with this.This particular attempt causes the player,"shape",to move far to the left of the blocks once it comes in contact.I'm sure that the hitboxes and the sides are correct.The tiles are all placed in the world relative to their array index. My intended method is to move the player to the top of the tile when the top is collided then to check for side collisions and reverse the effect of setting at the top so that the player doesn't teleport to the top when he hits the side of another tile.Does anyone see what mistakes there are?Is this method even plausible.If there is a simpler method please mention how to do so.Thanks!



                update(RenderWindow &window)
                {
               
                        //update collision sides of player
                        left=shape.getPosition().x;
                        right=shape.getPosition().x+hitbox.x;
                        top=shape.getPosition().y;
                        bottom=shape.getPosition().y+hitbox.y;
                        Vector2f over;
                        bool exitloop=false;
                        bool sidehit=false;
                        for(int x=0;x<gmap.mapsize.x;x++)
                        {
                               
                                if(exitloop==true)
                                {
                                        break;
                                }
                               
                               
                               
                               
                                for(int y=0;y<gmap.mapsize.y;y++)
                                {
                       
                                        if(exitloop==true)
                                                break;
                                       

                               
                       
                       
                                                               
                                        if(gmap.tile[x][y].active==true)
                                        {
                                               
                                                if(gmap.tile[x][y].right<left||gmap.tile[x][y].left>right||gmap.tile[x][y].bottom<top||gmap.tile[x][y].top>bottom)
                                                {
                                               
                                                        velocity.y+=Gravity;
                                                }
                                                else
                                                {
                       
                                                       
                                                        if(bottom>=gmap.tile[x][y].top-velocity.y)
                                                        {                                                              

                                                                shape.setPosition(shape.getPosition().x,gmap.tile[x][y].top);
                                                                velocity.y=0;
                                                                if(Keyboard::isKeyPressed(Keyboard::Up))
                                                                {
                                                                        velocity.y=-2;
                                                                }
                                                        }
                                                       
                                               
                                                        exitloop=true;
                                                       
                                                }
                                        }
                                       
                                        if(gmap.tile[x+1][y-1].active==true)
                                        {
                                               
                                                if(right>gmap.tile[x+1][y-1].left&&bottom>gmap.tile[x+1][y-1].top)
                                                {
                                                                velocity.x=0;
                                               
                                                                shape.setPosition(shape.getPosition().x-1,shape.getPosition().y+gmap.tile[x][y].hitbox.y);//set x to left and set bottom to original standingfloor to make up for the change made by top collision
                                                       
                                                }
                                       
                                                       
                                        }              
                       

                       
                       
                                }
                       
                        }
                       
                       
                       
                       
                       
                       
                       
                        if(Keyboard::isKeyPressed(Keyboard::Right))
                        {
                                velocity.x=2;
                        }
                        if(Keyboard::isKeyPressed(Keyboard::Left))
                        {
                                velocity.x=-2;
                        }      
                        else if(!Keyboard::isKeyPressed(Keyboard::Right))
                        {
                                if(velocity.x>0.05)
                                        velocity.x-=0.05;
                                       
                                if(velocity.x<-0.05)
                                        velocity.x+=0.05;
                        }
                       
                        shape.setPosition(shape.getPosition().x+velocity.x,shape.getPosition().y+velocity.y);
                        window.draw(shape);
                       
                }
 

9
Graphics / Does SFML only have large texture errors at compile time?
« on: March 03, 2023, 10:44:24 pm »
So I know that when there's a texture that too large you'll get an error but I wasn't sure if this mattered once compiled.If you compiled the program on a computer that allowed that larger texture but ran the compiled program on another computer that isn't supposed to be able to handle that texture size,will it load the texture or  give that error? 

10
General / My animation class skips the last frame of an animation.
« on: February 02, 2023, 05:08:00 pm »
I've been fiddling with this for hour trying to figure out why the last frame doesn't show.By setting the bool repeating to false I found that it sort of skips the fourth frame and counts the first as the fourth.Any ideas on why this is happening?The part that does the animation is the function update().

class SPR
{
        public:
                Sprite sprite;
                bool isanimation;
                Clock clock0;
                IntRect textureRect;
                IntRect currentRect;
                int frames;
                int remainingframes;
                bool nextrow=false;
                Texture referencetexture;
                bool repeats;
                int customXreturnpoint;//the position at which the animation resets to the next row;
                float delay;
                startanimation(IntRect startrect,int pframes,float p_delay=0.15,bool p_repeats=false,int p_customXreturnpoint=0)
                {
                        if(!isanimation)
                        {
                                frames=pframes;
                                remainingframes=frames;
                                repeats=p_repeats;
                                nextrow=false;
                                textureRect=startrect;
                                currentRect=textureRect;       
                                customXreturnpoint=p_customXreturnpoint;
                                delay=p_delay;
                                isanimation=true;
                        }
                }              
               
                SPR(RenderWindow &window,Texture &texture,IntRect ptextureRect=IntRect(0,0,0,0),Vector2f pixelpos=Vector2f(0,0),bool animated=false,int pframes=0,float p_delay=0.15,bool p_repeats=false,int p_customXreturnpoint=0)
                {
                        if(ptextureRect==IntRect(0,0,0,0))
                        {
                                ptextureRect=IntRect(0,0,texture.getSize().x,texture.getSize().y);
                        }
                        if(pframes==0)//if user types 0 then change it to 1 since 0 just removes first frame if this is ever used as animation.Even if the startfunction sets the frames it still will cut off the first frame if the declaration function sets frames as 0.
                        {
                                cout<<"Warning! One of your animations is set to frame 0 at declaration."<<endl<<" Only positive numbers exist for frames!"<<endl<<" Frame 0 has been changed to 1 to accomodate."<<endl;
                                pframes=1;
                        }
                       
                        isanimation=animated;
                        sprite.setTexture(texture);
                        sprite.setTextureRect(ptextureRect);
                        textureRect=ptextureRect;
                        frames=pframes;
                        repeats=p_repeats;
                        remainingframes=frames;
                        sprite.setPosition(pixelpos);
                        referencetexture=texture;
                        currentRect=textureRect;
                        customXreturnpoint=p_customXreturnpoint;
                        delay=p_delay;
                }
               
                update(RenderWindow &w);
               

};



SPR::update(RenderWindow &w)
{
        if(customXreturnpoint==0)
        {
                customXreturnpoint=referencetexture.getSize().x;
        }      
        if(isanimation)//The last frame is getting skipped and should not!
        {
                if(clock0.getElapsedTime().asSeconds()>delay)
                {
                        if(remainingframes>0)
                        {
                               
                                if(currentRect.left<=customXreturnpoint-currentRect.width)
                                {
                                        remainingframes--;
                                        currentRect.left+=currentRect.width;
                                }
                                if(currentRect.left>=customXreturnpoint-currentRect.width)
                                {
                                        currentRect.top+=currentRect.height;
                                        currentRect.left=textureRect.left;
                                        remainingframes--;
                                       
                                }
                        }
                        if(remainingframes==0)
                        {
                                if(repeats==true)
                                {
                                        currentRect=textureRect;
                                        remainingframes=frames;
                                }
                                else
                                {
                                        currentRect=textureRect;
                                        remainingframes=frames;
                                        isanimation=false;
                                }
                        }
                        sprite.setTextureRect(currentRect);
                        clock0.restart();              
                }
               
       
        }
       
        w.draw(sprite);
}


int main()
{
       
        RenderWindow window(VideoMode(640,480),"Animation");
        Texture t1,t2,t3,t4,t5;
        t1.loadFromFile("ff-stat.png");
        t2.loadFromFile("hiker.png");
        t3.loadFromFile("Mario.png");
        t4.loadFromFile("birdfly.png");
        t5.loadFromFile("squirrel.png");
        SPR test1(window,t1,IntRect(0,0,128,128),Vector2f(300,300),true,13,0.15,true);
        SPR test2(window,t3,IntRect(0,0,16,33),Vector2f(400,300),true,48,0.15,true);
        SPR test3(window,t1,IntRect(0,0,128,128),Vector2f(300,200),false,13,0.15,true);
        SPR test4(window,t2,IntRect(0,0,50,50),Vector2f(300,100),false,4,0.5,true);
        SPR test5(window,t1,IntRect(0,0,128,128),Vector2f(500,300),true,13,0.15,true);
        SPR test6(window,t2,IntRect(0,0,50,50),Vector2f(600,300),true,4,0.15,true);
        SPR test7(window,t4,IntRect(0,0,195,195),Vector2f(400,200),true,4,0.5,false);
        SPR test8(window,t5,IntRect(6,25,158,105),Vector2f(200,200),true,8,0.15,true);
                                       
        while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();
        }
       
       
       
        window.clear(Color::Yellow);
       
       
        if(Keyboard::isKeyPressed(Keyboard::Left))
                {
                   test2.startanimation(IntRect(0,0,16,33),42,0.15);test2.sprite.move(-0.3,0);
        }
       
        if(Keyboard::isKeyPressed(Keyboard::Right)) test2.sprite.move(0.3,0);
       
        if(Keyboard::isKeyPressed(Keyboard::Up))
                {
                   //test2.startanimation(IntRect(17,96,32,16),3,0.15,true,128);test2.sprite.move(0,-0.3);
        }
        if(Keyboard::isKeyPressed(Keyboard::Down)) test2.sprite.move(0,0.3);
       
        test1.update(window);
        test2.update(window);
        test3.update(window);
        test4.update(window);
        test5.update(window);
        test6.update(window);
        test7.update(window);                          
        test8.update(window);  
                window.display();  
       
        }
}



 
 

11
Graphics / Draw sprite to renderwindow automatically
« on: December 23, 2022, 12:44:58 am »
Hi everyone.
I was wondering if theres a more automated way to draw sprites to the window.
Everthing sfml related i've seen has drawn sprites to the window by typing out every sprite that the window should draw.
window.clear();
window.draw(sprite1);
window.draw(sprite2);
window.draw(sprite3);
window.draw(sprite4);
window.draw(sprite5);
window.draw(sprite6);
window.draw(sprite7);
and so on...

Is there a more efficient way thats more automated?Maybe by a class?   

12
General / 32 bit sfml can't be used when on 64 bit system.
« on: December 02, 2022, 12:46:03 am »
I'm having a trouble getting 32 bit sfml to compile at all on a 64 bit system.I'm pretty sure the compiler is set to 32 bit and it doesn't give any errors about not being compatible but it doesn't recognize the existence of sfml.I'm using devc++ 5.11 on 64 bit windows and I have the linking done in compiler settings.
Here are the settings I used.

In the linker I have this:

-static-libgcc -lsfml-graphics



In the directories tab under libraries:
C:\SFML-2.5.1\lib    //this is the correct directory.

In the directories tab under c++ includes:

C:\SFML-2.5.1\include //this directory is correct also.

The compiler is set to TDM-GCC 4.9.2 32-bit release


The error received is [Error] SFML\Graphics.hpp: No such file or directory


This is the placed include script.it seems fine to me.
#include <SFML\Graphics.hpp>
using namespace sf;


This problem only occurs when using 32 bit sfml on this machine.64 bit sfml compiles fine but I would rather use 32 bit.

I'm really stumped on this one.I hope I gave enough details. Any ideas on what's causing the problem?

By the way,I would like to do static linking if you could show me how please.Thankyou

13
Graphics / settexturerect seems offset.
« on: November 04, 2022, 09:25:52 pm »
I've been having this problem since I started using sfml and I still cant figure it out.I don't know if its offset or what but settexture rect just doesn't seem to display what is actually in the rect.left.I have been simply using Texture.loadfromfile for animations but its a waste of performance to keep loading it.Here is some script of an attempt at using settexturerect.
#include "testfunction.h"
#include <SFML/Graphics.hpp>
using namespace sf;
int x;
float preclock;
Clock clock2;
float animate(Sprite &sprite,float delay)
{
       
       
        if(clock2.getElapsedTime().asSeconds()>preclock+delay)
        {
               
               
                if(x>=13*40)
                {
                        x=0;
                }
                else
                {
                       
                        sprite.setTextureRect(IntRect(x,0,40,32)); //right here
                        x+=40;
                }
                preclock=clock2.getElapsedTime().asSeconds();
        }
}
 



This code works when I have texture.loadfromfile but with this it shows blank with a black line at the top.I'm sure that it has the right position and that simply selecting the next animation frame as a test still shows blank.I have tested this without the function.Any ideas on what's happening here? Thanks.

14
Graphics / Is there a resolution limit in SFML?
« on: November 03, 2022, 11:50:13 pm »
Is there a resolution limit and if so then what is it?So I loaded a 5760x1080 background into a texture for a scrolling background and I got this error.
"Failed to create texture, its internal size is too high (8192x2048, maximum is 2048x2048)"
Could someone please tell me what causes this error?
The window size is set to 1920x1080.

15
Graphics / Convert mouse coordinates to world coordinates.
« on: October 25, 2022, 10:09:26 pm »
How do you convert mouse coordinates to game world coordinates?I've been trying to use mapcoordsTopixel but i'm not sure how.
This way doesn't work.It keeps saying about expecting a primary expression before the token ","

Vector2i Position2=Mouse::getPosition(window);
Vector2i Position=RenderTarget::mapCoordsToPixel(Position2& ,window);

So i've tried many different ways with this and I still can't find a way to make it work.What am I doing wrong?Thanks in advance.
    

Pages: [1] 2
anything