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

Pages: [1]
C / Compile CSFML for Linux and windows 98
« on: February 25, 2020, 11:52:19 pm »
I tried to compile CSFML in Linux and I had no luck. Also the last compiled csfml for linux was outdated and did not work (there are a lot of posts about this, so I'll just forget about it).

Is it possible to compile a csfml program for Linux (libs and executable) from a windows system using gcc?.

I also read sfml is compatible with all windows versions, (including windows 95-98). So I wanted to test if the program is optimized and it works on slow old systems with opengl 1.1.

I tried windows 98 inside an emulator called Pcem, and windows complains about dll's being too modern. So I want to know if I could also compile the exe and dll's for old systems using gcc.

My current computer is running windows 10 x64, and I'm using the 32 bit version of csfml.


Audio / Re: Disable audio filters
« on: February 06, 2020, 09:01:36 pm »
I think nobody imagined OpenAL would be used with such low frequencies, so I just resampled the audio myself and solved the issue.

Input files are still at low sample rates, but I used the sound buffer functions from SFML to resample them internaly to 44100 (just copy from a sample array to other array), so that they sound "unfiltered" in all sound players.

About the sounds I uploaded...

I created the "filtered" wave in audacity, just resample from low sample rates to 44100, and it will also add some default dithering, destroying the retro sound.
The "unfiltered" file was created using open modplug tracker, which has a lot of "retro" options for audio.

Here you see the resampling options in open modplug:

And here the resampled waveforms (44100Hz):

Hope this helps someone trying to get retro sounds :).

Audio / Re: Disable audio filters
« on: February 05, 2020, 06:49:53 pm »
What filters are you referring to exactly?

I did not explain it very well, I think people call it "sound dithering". I attached two samples to show it.
I just resampled a small sample from 8192 Hz to 44100 without any filters.

I just can use the resampled sounds like that, but I wanted them to be tiny in size.

If the hardware or the player has no sound filter, it sounds like the unfiltered version. SFML is playing like the filtered one.

Audio / Disable audio filters
« on: February 05, 2020, 05:47:39 pm »
I didn't  find anything related to this in the forums.

I am programming some kind of "fantasy computer"in CSFML just for fun, similar to pico-8 (and things like that).

I nearly got it working, and it uses tiny wave samples with very low quality (1000Hz). I want the sound to be even more "retro" disabling the filters.

Is it possible to disable the fefault filters used by openal wave player?


SFML projects / Re: Selba Ward
« on: February 05, 2020, 05:40:56 pm »
Thank you for your kind words. It's always a good feeling when you hear that someone is enjoying Selba Ward.

I'm not sure I understand your move from C++ to C but I won't judge (too much) ;D

Selba Ward is built so that each drawable object can be used separately from any of the others. So, to use just Console Screen, you can simply copy the files into your project and link them. The (3) files you need would be ConsoleScreen.hpp, ConsoleScreen.cpp and Common.hpp. You could, if you wish, also include PaletteEnums.hpp if you wish to use those but this is not required. Then, just compile along with the rest of your project.
It's worth noting, though, that the files themselves are written in C++ so would need converting to plain C first. Or you could build just those files as a library and use that. Never needed to do this though so it may or may not work or even be possible.

Hope it works out for you!

Thanks a lot!

SFML projects / Re: Selba Ward
« on: January 26, 2020, 11:40:57 pm »
I want to thank you for the amazing console screen, it is just what I was looking for, to make a simple text editor in SFML :).

Now I'm using CSFML, so I can't use this, but I wonder if I can build a little lib only with the console screen sources, or do I need to compile all sources for the console to work?

Graphics / Re: CSFML: access image / texture pixels
« on: January 22, 2020, 10:21:59 pm »
I've been testing, I created a bug in my program which is now solved, so sfImage_copyImage had no issues  :).

Graphics / CSFML: access image / texture pixels
« on: January 21, 2020, 07:48:03 pm »
Is there any way to access the pixels of images and textures in CSFML without using setPixel, getPixel or sfImage_getPixelsPtr ?

Can I access the sfImage struct to get the pixels in CSFML or do I have to use the C++ SFML?

I'm asking this because sfImage_copyImage is not working the way I wanted.

For example I want to copy a "tile" (8x8 pixels) from a big image to a smaller one.

The following code should take the first 8x8 tile, (from 0,0 to 8,8 of the big image) and paste it to the top part of the small image.

Code: [Select]
sfImage_copyImage(Small_Image,Big_Image, 0, 0, (const sfIntRect){0, 0, 8, 8}, 0);

In my case, this just pastes the big image on top of the small one, ignoring the pixels that don't fit on the small image like a photoshop paste  :'(.

Maybe I'm using the sfImage_copyImage the wrong way?


EDIT: I really don't know why... But it worked inside a loop
Code: [Select]
int x = 0;int y = 0;int i = 0;
for (y = 0; y < 128; y+= 8){
for (x = 0; x < 128; x+= 8){
sfImage_copyImage(Tileset,New_Tileset, 0, i, (const sfIntRect){x, y, 8, 8}, 0);
i+= 8;

It loads all tiles correctly from a 128x128 image.

(I'm sorry I should have posted this in the graphics section).

General / Re: wait for vsync custom function
« on: January 19, 2020, 04:58:37 pm »
Thanks Laurent.

I first tried to use the mutex functions from c, and I had some trouble with them. Now I used sfMutex functions and everything seems to work ok.

The render thread is run in the main function:

Code: [Select]
void Render(){
sfRenderWindow_clear(render_window, sfColor_fromRGB(0,0,0));

sfRenderWindow_drawSprite(render_window, sprite, NULL);


If I understand everything OK, the update thread won't be able to modify anything being read by the Render() function in the main thread, including the SPR_X and SPR_Y I defined for sprites.

General / wait for vsync custom function
« on: January 19, 2020, 02:05:09 pm »

I'm using CSFML, and I created a c code in the main thread, which draws a sprite to a window and uses sfRenderWindow_setFramerateLimit(60).
The sprite x and y positions are taken from two global variables (SPR_X and SPR_Y).

Don't ask why I'm doing the following :P... but I created a thread which only modifies the sprite position by changing SPR_X and SPR_Y variables. The problem is, how do I sync the thread to the vsync of the main one, so that the sprite moves at 60 fps?

I used usleep(1000000/60) and it works, but you surely know what happens next... Sometimes the positions are changed in the middle of a frame, and you can see screen tearing.

Then I tried using sfRenderWindow_display() again inside the thread function. But that resulted in a black screen. So I think I must use a custom sfRenderWindow_display():

Code: [Select]
void custom_windowdisplay()
    // Display the backbuffer on screen
    //if (setActive()) m_context->display(); don't do this again!!

    // Limit the framerate if needed
    if (m_frameTimeLimit != Time::Zero)
        sleep(m_frameTimeLimit - m_clock.getElapsedTime());
        //m_clock.restart(); //don't restart the clock again!!

I can convert that to CSFML, But I need to get the same clock used internally for the original sfRenderWindow_display(), and also get the m_frameTimeLimit value.

How do I get the clock and the m_frameTimeLimit?.

Is there any other way to do it? I read about "mutex", but that was way complex for me to understand, and I did not make it work.


Pages: [1]