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

Pages: [1] 2 3
1
I've recently come from SDL to try out SFML and I've discovered there's no line shape class. I generally think it's pretty ridiculous to have rectangle, circle and that but not have the most basic line shape.

I've seen one reply to something on SFML that was the developer saying it can be created using VertexArrays but I don't understand the point then? It's basically like saying. Oh something a program doesn't work on your computer? Why don't you go build your own computer and program.

Yeah it can be created using VertexArrays but then so can a rectangle, a circle and so on. It seems like such a trivial feature that will save people the time of making there own custom class for something that should be implemented already. It seems just a bad argument to say to use VertexArrays when it can be implemented by the SFML developers. If your telling me to use VertexArrays then you might as well just tell me to make my own C++ graphics library.

For example in SDL you have SDL_RenderDrawLine(SDL_RENDERER, x1, y1, x2, y2). Which saves time from creating your own class every time you want to draw a line.

So basically I'm wondering if it's possible to simply add a LineShape class where you can say:

line.setPosition(sf::Vector2f(32, 32), sf::Vector2f(64, 64));
line.setFillColor(sf::Color::Red);
line.setOutlineColor(sf::Color::Green);
line.setOutlineThickness(5);
line.setThickness(10);

2
Graphics / Re: need some help with glowing text
« on: August 24, 2015, 02:50:40 pm »
does anyone know how to create such a glowing effect like here

http://cooltext.com/Logo-Design-Animated-Alien-Glow

Searched a lot but couldn't find anything. Lots of info about glowing for 3d but I think this can be done much easier rather than for 3d.

This is a pretty old topic but I'd just like to add that if you just want a really simple short way then I'm sure you can just create an circle shape or rectangle shape. Set it as the same size as your text then add a transparency gradient to it.

3
Window / Re: Window resizing?
« on: August 21, 2015, 01:05:51 pm »
+Jesper Juhl

So is there no way to disable the resizing? It seems more like an annoyance than a feature of SFML.

4
Window / Window resizing?
« on: August 21, 2015, 12:54:12 pm »
I've recently started using SFML and it's great. I've got one problem with it though. In for example Java when creating a window and resizing it the objects inside the window will stay the same size. But in SFML it automatically resizes to fit the screen. Creating a stretched ugly mess I've looked online yet can't find anywhere that lets you disable the window resizing like this?

5
SFML projects / Re: Klinke
« on: August 20, 2015, 09:54:48 pm »
+zsbzsb

Ah, sorry for the quotes I'll stop using them when replying to comments.

6
SFML projects / Re: Klinke
« on: August 20, 2015, 09:24:34 pm »
I wish you the best of luck. But honestly, I doubt very much that you'll be able to actually get any real programs running like that.
But I'd like you to prove me wrong.

Small question: have you ever written a compiler or interpreter before? If not, then you might want to study up a bit on that first.
I wrote a recursive-descent C89 interpreter once (except for a few bits like volatile, register, union and other niche parts of the language) and I can tell you that it's not a trivial exercise. And parsing C++ is many times harder than C89.

If you want something fairly simple to test your program on, then let me know when it successfully converts my two simple examples from the wiki:
 https://github.com/SFML/SFML/wiki/Source:-Bouncing-ball
 https://github.com/SFML/SFML/wiki/Source:-Jukebox

I want to stress again that I'd love to be proven wrong and see you succeed. I'll honestly be impressed. But I must admit I don't believe your aproach will get you very far.

For your small question. I have sort of written an interpreter. But it was in Java and it was on my old Windows 7 laptop and I just completely forgot about it. I think I called it Flex or something? It literally just read .flex files then converted it over to Java and then compiled it then compiled it all into a .jar file.

Edit : I'm pretty sure your right though. I'm going to try and learn how to make Python interpreter that interprets Python code to C++. Because Python is pretty simple, then I'll take a look at C++ to JavaScript. I'm guessing I'm going to have to establish some common link between all programming languages. Such as for example all programming languages have variables and if statements.

7
SFML projects / Re: Klinke
« on: August 20, 2015, 08:24:32 pm »
I don't mean to be rude or discourage you. But I think that you are massively underestimating the task at hand.

To translate C++ to JavaScript+HTML you need to actually parse and understand the C++ grammar and then generate equivalent JavaScript.
That means you need a tokenizer, a lexer, a parser that can build a proper AST, and a backend to emit JS based on that AST. In short; you need a C++ compiler that can emit JS.
This is exactly what the Emscripten guys are building (and it's a multi-man-year effort, even starting with LLVM as the base).
You won't get far by doing some pattern matching on C++ sources (detecting Window width and height etc) and then generating HTML/JS from that - enjoy dealing with stuff like templates, the most vexing parse, overload resolution, ADL, pointers, references, exceptions, threads, atomics and much, much more.

Your energy would be much better spent by helping the Emscripten guys with their compiler and helping port SFML to modern OpenGL that Emscripten can deal with. That might actually have some chance of resulting in a real solution.

I don't want to build a program that matches what the Emscripten people have made. That doesn't work from what I heard and I simply want to make a basic program that I can use to port my SFML code to HTML5 canvas. Do you know HTML5/JS code for canvas? I don't even need to bother with threads, pointers, etc! Also if every time a project was hard you quit then your clearly not going to get anywhere.

I'm literally going to have to handle a few things. For example:

- Detecting a window, window width, window height (possibly window title if I want to display that somewhere)
- Detecting the basic functions such as RectangleShape, which I literally need to say to JS only bother with where it renders then create a Rectangle and render it that, because I'm reading from top to bottom this will automatically go in the correct order
- Detecting keyboard events which is again as simple as telling JS to only bother with where it gets the keys then do that
- Variables such as integers, those are pretty easy
- And a few other things

I'll just be making a SFML project then port it using Klinke and if there any problems I'll fix/add them.

8
SFML projects / Re: Klinke
« on: August 20, 2015, 04:01:12 pm »
I doubt anyone is gonna download some exes from your repository to "see" the progress. Instead you actually might want to provide the code - at least that's what Git was created for anyways. :P

Yeah, I'm pretty sure it was mainly created for open-source projects and that but I don't really want to upload it to something like filedropper.com that's going to take down the download like every month. Plus it's a lot easier to just download the .zip and see the individual versions and pick one instead of searching for what versions there are then going to filedropper.com links with no explanation and then just downloading random stuff. Also GitHub is more secure! If I do put the code up I won't put it in the same repo as it ends up losing the binaries and you have people searching through source code and that for the .exe versions.

Edit : Also, the code is pretty messy lol.

9
SFML projects / Klinke
« on: August 20, 2015, 01:14:42 pm »
 ;D  Hey guys!  ;D I recently asked a question here : http://en.sfml-dev.org/forums/index.php?topic=18824.0 about whether you can write a SFML game and get it on the web. From what I gathered there's some outdated program for C++ to HTML that doesn't work with SFML. Basically I really wanted to get SFML stuff on the web so you can play it in your browser and there were no programs for doing that so I decided to start a project called Klinke (note? I'm not sure if it's suppose to be here. It's in C++ and I'm writing SFML code and that). Basically it reads .cpp files with SFML stuff in (2.3.1). Then it does it's best to convert it to HTML5 canvas code. Which basically is a window on a webpage. If you don't know what a canvas looks like then heres an example from some HTML5 tutorial thing: http://www.lostdecadegames.com/demos/simple_canvas_game/.

Basically you download Klinke.exe. You put it in the same directory as the files you want to convert. Then you go into the console and run "Klinke [name of file]". Note: don't write .cpp at the end. It opens the file then read's it and then basically writes to a few variables saying what is in the program. Right now it only detects a window. It get's it's width. Then it writes it to a file called "index.html". Which can then be opened.

Notes :
Right now I just wanted to post it so you can see my progress and also in case it helps anyone. As of right now it's not really the best thing as it only detects and window then it's width. I'm going to be working on other versions but this is literally what I did in one day:

Download: https://github.com/HydraPlays/Klinke

v0.01:
Klinke detects window's and reads their width

v0.02
Klinke now detects the window's height aswell

10
Feature requests / Re: Windows OS ::getDesktopMode() fix
« on: August 20, 2015, 01:13:11 pm »
I don't mean to revive an old topic but does anyone actually know why Microsoft made it so the Windows window borders are bigger? It's a little weird how it's only on the sides.

11
General / Re: Does SFML work on the web?
« on: August 19, 2015, 04:28:08 pm »
No.

IIRC Emscripten requires OpenGL ES 2 and SFML doesn't support that yet.

Ah okay. Thanks.

12
General / Re: Does SFML work on the web?
« on: August 19, 2015, 04:25:43 pm »
binary1248 has once played around with a port of SFML that compiles for Emscripten and he ported my last Ludum Dare game to it. You can play it here, but it's not officially support for now.

Okay, so is Emscripten like Java 3D in the fact that it works but isn't up to date or very compatible?

13
General / Re: Does SFML work on the web?
« on: August 19, 2015, 04:06:54 pm »
Okay, I'll try something else then.

14
General discussions / Re: Incredible performace of Lua (luajit) over C++
« on: August 19, 2015, 03:59:47 pm »
You take a 3 months old post out of context, denying any backgrounds leading to it, for... what? If you have a problem with my attitude, write me a PM, there's no need to necromance this thread for an off-topic discussion.

I didn't purposely deny the lead up I was just quoting the parts of it that were rude. For people who didn't want to read the whole post which I quoted.

15
General / Does SFML work on the web?
« on: August 19, 2015, 03:55:07 pm »
If for example I created a game in SFML. Is there a way I can then put it on a website like how Unity has it's special plugin for running Unity games?

Pages: [1] 2 3