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

Pages: [1] 2 3
1
SFML projects / Re: SFML2 Wrapper for OpenEuphoria
« on: July 09, 2023, 01:30:59 am »
What's the difference to https://github.com/gAndy50/EuSFML2 ?

Should I replace the EuSFML2 link on the Bindings page or add the SFML2Wrapper in addition?

https://www.sfml-dev.org/download/bindings.php

The difference is it uses a newer code base. It also uses newer libraries for improved support using C structs. I think it'd be best to replace the EuSFML link with the newer SFML2 wrapper.

2
SFML projects / SFML2 Wrapper for OpenEuphoria
« on: July 09, 2023, 12:11:43 am »
Hello,

I have recently finished my wrapper for SFML 2.5.2/2.6.0 for OpenEuphoria. It is based off of CSFML. So I am updating my wrapper as CSFML gets updated. However it is very usable and works well. Note that I built the DLLs using 32-Bit, so you will need to use the 32-bit version of OpenEuphoria.

You can however use the 64-bit DLLs, but you will need to use the 64-bit version of OpenEuphoria. I have not tested the 64-bit version. I used the 32-bit version for compatbility reasons.

OpenEuphoria is a programming language somewhat similar to BASIC in syntax, but much more flexible.

https://openeuphoria.org/index.wc

https://github.com/gAndy50/SFML2Wrapper

Code: [Select]
--EuSFML RenderWindow Example
--Written By Andy P. (Icy_Viking)

include std/ffi.e
include std/math.e

include sfml_system.e
include sfml_window.e
include sfml_graphics.e

sequence mode = {800,600,32} --create window that is 800x600 and 32-bits

atom win = sfRenderWindow_create(mode,"Window",sfClose,NULL)

if win = -1 then
puts(1,"Failed to create window!\n")
abort(0)
end if

atom evt = allocate_struct(sfEvent)
atom evt_type = 0

while sfRenderWindow_isOpen(win) do

while sfRenderWindow_pollEvent(win,evt) do
evt_type = peek_type(evt,C_UINT32)
if evt_type = sfEvtClosed then
sfRenderWindow_close(win)
end if
end while

sfRenderWindow_clear(win,sfBlack)

sfRenderWindow_display(win)
end while

sfRenderWindow_destroy(win)

3
C / Re: Is this A Bug?
« on: July 07, 2023, 09:27:18 am »
To test whether it's a bug in your binding of CSFML or SFML, you'd have to reproduce it in each.
So I suggest to write the example in C using CSFML and then in C++ using SFML, that way you should be able to narrow things down further.

Quote
I know that using sfVideoMode causes the screen to go fullscreen
When you say "you know", how do you know?

That was a typo in my words. I meant to ask if using sfVideoMode causes the screen to go fullscreen.  I'll have to test and see why the renderWindow is going full-screen even though it should appear as a regular window that is 800x600.

EDIT: I had the flags set to the wrong values. Its working as it should now.


--Wrong values
public enum type sfWindowStyle
   sfNone = 0,
   sfTitlebar = 1,
   sfResize = 2,
   sfClose = 8,
   sfDefaultStyle = 11 -- sfTitlebar | sfResize | sfClose
end type


public enum type sfWindowStyle
   --Correct values
    sfNone         = 0,
    sfTitlebar     = 1, -- 1 << 0
    sfResize       = 2, -- 1 << 1
    sfClose        = 4, -- 1 << 2
    sfFullscreen   = 8, -- 1 << 3
    sfDefaultStyle = 7  -- sfTitlebar | sfResize | sfClose
end type

4
C / Is this A Bug?[Solved]
« on: July 07, 2023, 03:14:41 am »
Hello,

I am currently writing a wrapper of SFML 2.6 for the OpenEuphoria programming language. I'm using the most updated version of CSFML for easier portability. Does using sfVideoMode causes the screen to go fullscreen, even though I have set the parameters so that it is a window.

https://openeuphoria.org/index.wc

My GPU is a RTX 3070 8GB.

Shouldn't the window appear as a normal window by default and not fullscreen, the video mode becomes 800x600, 32 when I test my program. I can post a actual C example if it makes it easier. Just wondering if this is a bug or something.

Code: [Select]
--Wrapper Code
public constant sfVideoMode = define_c_struct({
C_UINT, --width
C_UINT, --height
C_UINT --bitsPerPixel
})

public constant xsfRenderWindow_create = define_c_func(gfx,"+sfRenderWindow_create",{sfVideoMode,C_STRING,C_UINT32,C_POINTER},C_POINTER)

public function sfRenderWindow_create(sequence mode,sequence title,sfWindowStyle style,atom settings)
return c_func(xsfRenderWindow_create,{mode,title,style,settings})
end function

Code: [Select]
include std/ffi.e
include std/math.e

include sfml_system.e
include sfml_window.e
include sfml_graphics.e

sequence mode = {800,600,32}

atom win = sfRenderWindow_create(mode,"Window",sfClose,NULL)

if win = -1 then
puts(1,"Failed to create window!\n")
abort(0)
end if

atom evt = allocate_struct(sfEvent)
atom evt_type = 0

while sfRenderWindow_isOpen(win) do

while sfRenderWindow_pollEvent(win,evt) do
evt_type = peek_type(evt,C_UINT32)
if evt_type = sfEvtClosed then
sfRenderWindow_close(win)
end if
end while

sfRenderWindow_clear(win,sfBlue)

sfRenderWindow_display(win)
end while

sfRenderWindow_destroy(win)

5
General discussions / Re: SFML 2.6.0 released
« on: June 24, 2023, 08:52:57 am »
As soon as someone does all the necessary work

active maintainer (eXpl0it3r@sfml-dev.org)

 ;D

Oh no ;D

At least the basics are already done: https://github.com/SFML/CSFML/pull/186

Maybe that means a release is not that far away? Having CSFML makes it easier to port to other programming languages. If there's a way for me to help to get it out the door, maybe I can help?

6
General discussions / Re: SFML 2.6.0 released
« on: June 23, 2023, 10:23:55 pm »
Thanks! :)

You mean when CSFML will be updated?
As soon as someone does all the necessary work :D

Yes CSFML. Well I hope it can be done soon. No rush or anything.

7
General discussions / Re: SFML 2.6.0 released
« on: June 23, 2023, 04:05:11 am »
Congrats!

Just wondering, what would it take for a C port to be made?

8
SFML development / Re: SFML Roadmap
« on: April 21, 2023, 01:18:31 am »
I hope its okay if I ask this, but will SFML 2.6 have a C port release? I see that SFML 2.6 is getting very close to being released.

9
SFML projects / Ruby Wrapper Using FFI
« on: June 05, 2020, 09:47:06 pm »
Hello all,

I have made a wrapper for SFML in the Ruby programming language. This updates it to 2.5. It is based off the C port of SFML. I used FFI to help make things easier. I have most of the modules wrapped. The only one I don't have wrapped is the Net module. I noticed the last SFML wrapper for Ruby hasn't been updated in a long time. I don't have this on Github or anything yet. Just wondering if anyone would be interested?

Here is a brief example of the wrapper using FFI.
attach_function :sfRenderWindow_create,[:uint,:uint,:uint,:string,:uint32,:pointer],:pointer

require 'ffi'
#don't run infinite loop
x = Graphics.sfRenderWindow_create(800,600,32,"SFML",0,nil)
while Graphics.sfRenderWindow_isOpen(x)
        Graphics.sfRenderWindow_display(x)
end
 

10
SFML projects / EuSFML updated SFML 2.5!
« on: July 17, 2019, 05:03:03 am »
Hello,

I have updated my wrapper for SFML for the Euphoria programming langyage to 2.5 for SFML.

--Graphic Window Example
without warning
without type_check

include std/machine.e
include EuSys2.ew
include EuGfx2.ew

include sfFlags.e

atom win = sfRenderWindow_create(800,600,32,"My Window",sfClose,0)

if win = -1 then
        puts(1,"Could not create render window!\n")
        abort(0)
end if

constant event = allocate(4 * 6)

while sfRenderWindow_isOpen(win) do
       
        while sfRenderWindow_pollEvent(win,event) do
       
          atom eventType = peek4s(event)
          atom code = peek4s(event+4)
          atom alt = peek4s(event+8)
          atom control = peek4s(event+13)
          atom shift = peek4s(event+16)
          atom system = peek4s(event+20)
         
                if eventType = sfEvtClosed then
                        sfRenderWindow_close(win)
                end if
               
        end while
       
        sfRenderWindow_clear(win,sfBlack)
       
        sfRenderWindow_display(win)

end while

sfRenderWindow_destroy(win)
 

-Icy_Viking

11
General discussions / Re: SFML 2.5.0 released
« on: July 12, 2018, 01:58:32 am »
Any chance that the C binding of SFML will get updated to 2.5?

12
General discussions / Re: SFML 2.5.0 released
« on: May 11, 2018, 02:36:10 am »
This is great! Will CSFML get a 2.5.0 release?

13
General discussions / Re: SFML 3 - What is your vision?
« on: October 28, 2017, 03:43:53 am »
Will there be a C and .NET port of SFML 3?

14
Is there a roadmap for 3.0? I'm pretty curious to learn what will be coming in the new version of SFML.

15
SFML projects / Re: Screenshot Thread
« on: April 19, 2017, 02:56:01 am »
I expanded upon my last physics and SFML project. This time there are added platforms. Also, the physics properties have been tweaked to have some different effects.


Pages: [1] 2 3