C++ :: OpenGL Preserve States (SFML)

Feb 12, 2013

So I did read, however it said also that it was memory intensive and I had a question... I also came across this:

Window.pushGLStates();
Window.draw("Sfml Text");
Window.popGLStates();

The problem here is that none of these commands exist!

Window.draw should exist and even though I have all the proper includes I still get it telling me that 'Draw' is not a member of sf::Window

I have encountered that error many times everywhere across my sfml related code, it's not like they removed all those features in the update (Which they did not) but, why then would it not be a member?

View 8 Replies


ADVERTISEMENT

C :: GPIO Input With Changing States

Feb 4, 2014

I have a GPIO pin(GP4) on a microcontroller with a continuous digital pulse train coming into it. I am writing to it in C and do not have interrupts on this chip. I have been calling my input "#define inputA GP4". In C, I would like to be able to find the positive edge of a pulse and trigger the timer on it. I'm not sure if an XOR will accomplish what I need by storing inputA to another variable at some point. Would it be possible to accomplish this by writing code that acts like a positive-edge triggered flip-flop?

The other problem that I have is I need to be able to do this and not get caught in an infinite loop where I can still do other things sequentially with my code, if for instance, inputA goes to 0 and stays at 0 permanently. This means that my option of using while(inputA=0); is out of the question.

View 2 Replies View Related

C++ :: Creating Game Using SFML

Apr 26, 2014

I'm currently working on a 2D space shooter game in C++ using SFML library. What I need to know is how make an object (ex:laser) fire up from object (ex:player) when a user press button??

View 1 Replies View Related

C++ ::  SFML - How To Put Graphics Into Program

Oct 18, 2013

I use visual studio 2012. When I asked what I should use in order to put graphics into my program, I was told by the community that SFML works well. My only problem is that now I have SFML, where and how do I unpack it?

View 6 Replies View Related

C++ :: SFML 2.0 - Change Cursor

Sep 4, 2013

How to change what the cursor is in sfml 2.0?

View 1 Replies View Related

C++ :: Blinking Cursor In SFML?

Oct 22, 2013

so im trying to make a blinking cursor to give it a terminal feel, but it is speradic, since it is going at cycles instead of seconds. how can i fix this?

#include <SFML/Graphics.hpp>
int main() {
sf::RenderWindow App(sf::VideoMode(900, 750), "Fuck it. Uploads Happen.");
sf::Font
Font;

[Code].....

View 14 Replies View Related

C++ :: Tiled Map Loader For SFML

Jun 14, 2013

So I have the following code using [URL] ..... It compiles correctly, but does not display the map on the screen. Is it an issue with my code or an issue with the map file itself?

#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
#include <level.h>
int main(){
sf::RenderWindow window(sf::VideoMode(640, 480), "");

[Code] ....

View 1 Replies View Related

C++ :: Blinking Window In SFML

May 16, 2013

using SFML in visual studio 2012 ... this code gives blinking window.

#include<iostream>
#include<SFMLGraphics.hpp>
using namespace std;
sf::RenderWindow window (sf::VideoMode(800,600),"GAME");

[Code]....

View 8 Replies View Related

C++ :: Red Black Tree - SFML

May 17, 2014

How to make a red and black tree using SFML ....because i really need...I really don't know how to use SFML i only know how to use win32 console.

View 3 Replies View Related

C++ :: SFML 2.0 Changing Alpha?

Sep 18, 2013

I want to change the alpha of a sprite without changing any other colours

View 4 Replies View Related

C++ :: Getting Sprite To Animate With SFML

Dec 10, 2013

So this is my first try animating on my own, without a reference right in front of me. It's not working, I did check some of the projects I've made in the past, but for one those were done with Allegro, and really it should be able to move over to SFML quite easily, but it's not. It does display on the window in the correct place, but there are 3 pictures in the file and I want it to cycle through them, but it shows all three at the same time, and it only works once. if I press space a second time, only one of the pictures shows up, and it doesn't cycle at all. Here is my .cpp file :

#include "headers.h"
#include "SwordSprite.h"
int top = 0;
int left = 88;
int right = 132;
int bottom = 35;
SwordSprite::SwordSprite() {

[Code] .....

View 2 Replies View Related

C++ :: Setting Up SFML With Eclipse CDT

Aug 12, 2013

I am having trouble setting up SFML 2.1 to run with the eclipse IDE for c++ development. I use MinGW for my compiler.

When I link my include folder, lib folder and dll's it will not run a simple SFML program.

View 2 Replies View Related

C++ :: SFML And OGL That Should Display A Rotatable Cube

Nov 26, 2013

I wrote some Code with SFML c++ and OGL that should display a rotatable Cube ....... it doesnt .. WHY?

#include<SFML/OpenGL.hpp>
#include<SFML/Graphics.hpp>
#include<iostream>
void display();
void specialKeys();

[code]....

View 4 Replies View Related

C++ :: SFML 2.0 Pixel Perfect Collision

Oct 15, 2013

I have the code and it compiles fine but it doesn't work. (i am using the coding made easy sfml 2.0 tutorials)

Code:

#include <SFML/Graphics.hpp>
#include <iostream>
#include <algorithm>
#include <vector>
class Player {
public:
sf::Sprite player;

[Code] ....

View 18 Replies View Related

C++ :: SFML 2.0 - Text Scrolling On Screen

Sep 19, 2013

I have screen scrolling working but i want to have text scroll with the screen. because at the moment my player moves and the screen scrolls but the text doesn't.

View 15 Replies View Related

C++ :: SFML Window Title Bar Font

May 7, 2013

Any way in sfml of changing the font style and/or size used in the window title for RenderWindow?

As a secondary point - can the colour and size of the title bar itself be changed?

View 1 Replies View Related

C++ ::  how To Make A Drop Down List In SFML

Sep 5, 2013

How can i made a Drop down list in SFML ? This drop down list contains names of different animals...

View 10 Replies View Related

C++ :: Positioning SFML Text Specifically?

Sep 20, 2013

I am trying to position and sf::Text relatively to another sf::Text. Not over, or beneath or anything like that, but after- like so:

theTexts.push_back(UnitOfText(Text(outputstring,defaultFont, 15),theColor));
int i = (theTexts.size() - 1);
std::cout << i;
sf::FloatRect textRect ( theTexts[i].theText.getLocalBounds() );
theTexts[i].theText.setOrigin (textRect.width / 2, textRect.height / 2);
if(theTexts.size() > 1)
{
theTexts[i].theText.setPosition(theTexts[i - 1].theText.getLocalBounds().left,theTexts[i - 1].theText.getLocalBounds().top);
}

View 4 Replies View Related

C++ :: Errors When Trying To Debug The Code (SFML)

May 22, 2014

I'm currently just trying C++ with SFML. So I've installe SFML 2.0 for Visual C++ 2010 Express 64 bit, and I get an error while trying to run the debug of my code.

//Libraries
#include <SFML/Graphics.hpp>
#include <iostream>
int main() {
sf::RenderWindow window(sf::VideoMode(1280, 720),"SFML Game1");
return 0;
}

And this is the result I'm getting when trying to run it

1
1>LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

View 3 Replies View Related

C++ :: Making A Space Game Using SFML 2.0?

Sep 14, 2013

i am making a space game using sfml 2.0. i want it to move depending on its rotation. so if it is rotated 20 degrees it move in the direction it is facing. how do you do it?

View 17 Replies View Related

C++ :: SFML - Writing Text To Screen?

Oct 19, 2013

I'm trying to output text to a window using sfml, but I don't know where to start. Using version 1.6 of sfml.

View 7 Replies View Related

C++ :: Map Generation Algorithm - SFML Array Of Sprites

Jun 7, 2014

So I am writing a map generation algorithm (with SFML), and it seems the problem is in here:

Sprite sprites[32][32];
void genmap(){
Texture grasstiletex;
grasstiletex.loadFromFile("data/grasstile.png");

[Code] .....

But when I run it I get: Unhandled exception at 0x69791f34 in sfmlproject.exe: 0xC0000005: Access violation reading location 0x001b5000.

View 9 Replies View Related

C++ :: SFML - Relative Position In Different Sized Windows

Apr 27, 2013

Is there any way in sfml version 2 that I can get objects in a graphics window to retain there relative positions and sizes when the window is resized? I have tried looking in the documentation for version 2 but with no luck.

As an example suppose the window is 800x600 and there is a line running right across the window at 3/4 of the way down (i.e at y=450). If the window is then made larger say 1280x1024 how would I keep the line in the same relative position (i.e all the way across 1280 and 3/4 of the y setting down).

View 3 Replies View Related

C++ :: OpenGL And 2D Games

Sep 12, 2013

How I can make 2D games in OpenGL. I have sprites, but when I load them in game, they're all big and stuff, not pixel for pixel how I'd like them. How can I do this?

View 16 Replies View Related

C++ ::  Use DirectX Or OpenGL?

Feb 6, 2014

I am because I don't know what to use OpenGL or DirectX? I heard some people saying I can use both. How is this? What is better for online games? And when I choose I will need some tutorials too ....

View 1 Replies View Related

C++ :: Making Menu Object In SFML - Access Violation Reading Location

May 15, 2014

I'm trying to make a menu object in SFML. So far all I've added is the ability to add buttons with text inside of them. I store the buttons in a vector and then loop through that vector to draw the buttons.

The error stems from line 24 of the 2nd piece of code.

Here's what I've got:

//MenuTest.h
#include <SFML/Graphics.hpp>
#include <string>
#include <vector>
class Menu1 {
class Button1 {
sf::RectangleShape body;

[Code] ....

This causes an error at the line window.draw(text); in Menu::Button::drawButton(). With the error "Access violation reading location (some memory address)".

Everything up to trying to draw the text works fine.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved