Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: SFML2 Wrapper for OpenEuphoria  (Read 2440 times)

0 Members and 2 Guests are viewing this topic.

MetalCoder

  • Newbie
  • *
  • Posts: 31
    • View Profile
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)

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11033
    • View Profile
    • development blog
    • Email
Re: SFML2 Wrapper for OpenEuphoria
« Reply #1 on: July 09, 2023, 12:36:02 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
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

MetalCoder

  • Newbie
  • *
  • Posts: 31
    • View Profile
Re: SFML2 Wrapper for OpenEuphoria
« Reply #2 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.