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

Pages: [1]
1
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)

2
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)

3
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
 

4
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

5
SFML projects / EuSFML 2
« on: July 17, 2016, 11:12:52 pm »
Hello,

I have updated my wrapper for SFML 2.3.2. Everything has been wrapped and been made to be as Euphoria friendly as possible. This was wrapped with the C version of SFML 2.3.2. You can find the project at

https://github.com/gAndy50/EuSFML2

Or

http://www.rapideuphoria.com


6
SFML projects / EuSFML2 or SFML2 for Euphoria - Updated
« on: July 09, 2013, 12:19:33 am »
Hello,

I have written a wrapper for SFML 2.0 in the Euphoria programming language. I have wrapped all the functions for each module of SFML. This wrapper uses the C binding of SFML. I'm sorry if I put this topic in the wrong forum, but I think it is in the right place.

https://github.com/gAndy50/EuSFML2

7
Graphics / SFML 2.0 Font Load Bug?
« on: May 04, 2013, 10:01:43 pm »
Hello,

I am having trouble whenver I try to load a font. When I goto load the font, the program shows a bunch of text in the console window, then crashes. However when I compile it without a font, it builds and runs normally.

game.h
        Font GameFont;

game.cpp
        if(!GameFont.loadFromFile("sansation.ttf"))
        {
                exit(EXIT_FAILURE);
        }

Not sure what the problem. Sorry if I posted in the wrong section. I'm using SFML 2.0, Visual Studio 2012 Express. Windows 7 64-bit Ultimate. Nvidia Graphics card 8600M GT. It says the program exits with a code of 0x1

8
General / VS2012 Linker(DLL) Error
« on: January 24, 2013, 10:52:31 pm »
Hello,

I am having trouble when trying to run the simpe SFML program. I'm using Visual Studio C++ 2012 Express. SFML is 1.6, I've added the correct libraries to the correct directories. When I build its fine and I get no errors, but when I try to run it, I get this. "sfml-system-d.dll'. Cannot find or open the PDB file."(without quotes) What does this mean? I've put the DLLs in the project folder.

Pages: [1]
anything