Skip to content
/ eleos Public

c++20 header-only library for exposing source engine interfaces

License

Notifications You must be signed in to change notification settings

kusabana/eleos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

~kusabana/eleos – έ‧λε‧ος ( mercy, compassion )

c++20 header-only library for exposing source engine interfaces

installation

  • cmake
# Subdir
add_subdirectory("path/to/eleos")

# FetchContent
FetchContent_Declare(
  eleos
  GIT_REPOSITORY https://github.com/kusabana/eleos.git
  GIT_TAG 1.0.0
)

FetchContent_MakeAvailable(eleos)

# ...

target_link_libraries(library PUBLIC eleos)
  • cmkr.build
[fetch-content]
eleos = { git = "https://github.com/kusabana/eleos", tag = "1.0.0" }

[target.library]
link-libraries = ["eleos"]

examples

// sample interface
class sample_interface : public eleos::interface {
public:
  sample_interface( )
      : eleos::interface( "ISAMPLEINTERFACE001" ) {}
  ~sample_interface( ) = default;

  // ...
};

// examples of exposing an interface through
// multiple interface names (variadic)
class sample_variadic_interface : public eleos::interface {
public:
  sample_variadic_interface( )
      : eleos::interface(
            "ISAMPLEINTERFACE001",
            "ISAMPLEINTERFACE002",
            "ISAMPLEINTERFACE003" ) {}
  ~sample_variadic_interface( ) = default;

  // ...
};

// sample plugin
class sample_plugin
    : public eleos::interface
    , valve::plugin_callbacks::v4 {
public:
  sample_plugin( )
      : eleos::interface( "ISERVERPLUGINCALLBACKS004" ) {}
  ~sample_plugin( ) = default;

  // ...
  virtual auto load( void * /*unused*/, void * /*unused*/ ) -> bool {
    return false;
  }
  virtual auto unload( ) -> void {}
  virtual auto pause( ) -> void {}
  virtual auto unpause( ) -> void {}
  virtual auto description( ) -> const char * { return "sample_plugin"; }
}

About

c++20 header-only library for exposing source engine interfaces

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages