Skip to content

Commit

Permalink
internal/glfw: remove unused functions
Browse files Browse the repository at this point in the history
  • Loading branch information
hajimehoshi committed Feb 7, 2025
1 parent ea93969 commit 947c87b
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 76 deletions.
10 changes: 0 additions & 10 deletions internal/glfw/cocoa_init_darwin.m
Original file line number Diff line number Diff line change
Expand Up @@ -561,13 +561,3 @@ void _glfwPlatformTerminate(void)

} // autoreleasepool
}

const char* _glfwPlatformGetVersionString(void)
{
return _GLFW_VERSION_NUMBER " Cocoa NSGL EGL OSMesa"
#if defined(_GLFW_BUILD_DLL)
" dynamic"
#endif
;
}

33 changes: 0 additions & 33 deletions internal/glfw/glfw_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,6 @@ import (
"unsafe"
)

// Version constants.
const (
VersionMajor = C.GLFW_VERSION_MAJOR // This is incremented when the API is changed in non-compatible ways.
VersionMinor = C.GLFW_VERSION_MINOR // This is incremented when features are added to the API but it remains backward-compatible.
VersionRevision = C.GLFW_VERSION_REVISION // This is incremented when a bug fix release is made that does not contain any API changes.
)

// Init initializes the GLFW library. Before most GLFW functions can be used,
// GLFW must be initialized, and before a program terminates GLFW should be
// terminated in order to free any resources allocated during or after
Expand Down Expand Up @@ -83,32 +76,6 @@ func InitHint(hint Hint, value int) {
C.glfwInitHint(C.int(hint), C.int(value))
}

// GetVersion retrieves the major, minor and revision numbers of the GLFW
// library. It is intended for when you are using GLFW as a shared library and
// want to ensure that you are using the minimum required version.
//
// This function may be called before Init.
func GetVersion() (major, minor, revision int) {
var (
maj C.int
min C.int
rev C.int
)

C.glfwGetVersion(&maj, &min, &rev)
return int(maj), int(min), int(rev)
}

// GetVersionString returns a static string generated at compile-time according
// to which configuration macros were defined. This is intended for use when
// submitting bug reports, to allow developers to see which code paths are
// enabled in a binary.
//
// This function may be called before Init.
func GetVersionString() string {
return C.GoString(C.glfwGetVersionString())
}

// GetClipboardString returns the contents of the system clipboard, if it
// contains or is convertible to a UTF-8 encoded string.
//
Expand Down
15 changes: 0 additions & 15 deletions internal/glfw/init_unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -340,21 +340,6 @@ GLFWAPI void glfwInitHint(int hint, int value)
"Invalid init hint 0x%08X", hint);
}

GLFWAPI void glfwGetVersion(int* major, int* minor, int* rev)
{
if (major != NULL)
*major = GLFW_VERSION_MAJOR;
if (minor != NULL)
*minor = GLFW_VERSION_MINOR;
if (rev != NULL)
*rev = GLFW_VERSION_REVISION;
}

GLFWAPI const char* glfwGetVersionString(void)
{
return _glfwPlatformGetVersionString();
}

GLFWAPI int glfwGetError(const char** description)
{
_GLFWerror* error;
Expand Down
18 changes: 0 additions & 18 deletions internal/glfw/x11_init_linbsd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1264,21 +1264,3 @@ void _glfwPlatformTerminate(void)
close(_glfw.x11.emptyEventPipe[1]);
}
}

const char* _glfwPlatformGetVersionString(void)
{
return _GLFW_VERSION_NUMBER " X11 GLX EGL OSMesa"
#if defined(_POSIX_TIMERS) && defined(_POSIX_MONOTONIC_CLOCK)
" clock_gettime"
#else
" gettimeofday"
#endif
#if defined(__linux__)
" evdev"
#endif
#if defined(_GLFW_BUILD_DLL)
" shared"
#endif
;
}

0 comments on commit 947c87b

Please sign in to comment.