Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#if !defined(_WIN32) && !defined(__APPLE_CC__)

#include "Headers/PlatformDefinesUnix.h"

#include <SDL_syswm.h>
#include <malloc.h>
#include <unistd.h>

void* malloc_aligned(const size_t size, size_t alignment) {
	return memalign(alignment, size);
}

void  malloc_free(void*& ptr) {
	free(ptr);
}

int _vscprintf (const char * format, va_list pargs) {
    int retval;
    va_list argcopy;
    va_copy(argcopy, pargs);
    retval = vsnprintf(NULL, 0, format, argcopy);
    va_end(argcopy);
    return retval;
}

namespace Divide {

    bool PlatformInit() {
        return PlatformPostInit();
    }

    bool PlatformClose() {
        return true;
    }

    bool CheckMemory(const unsigned int physicalRAMNeeded, SysInfo& info) {
        long pages = sysconf(_SC_PHYS_PAGES);
        long page_size = sysconf(_SC_PAGESIZE);
        info._availableRam = pages * page_size;
        return info._availableRam > physicalRAMNeeded;
    }

    void getWindowHandle(void* window, SysInfo& info) {
        SDL_SysWMinfo wmInfo;
        SDL_VERSION(&wmInfo.version);
        SDL_GetWindowWMInfo(static_cast<SDL_Window*>(window), &wmInfo);

        info._windowHandle = wmInfo.info.x11.window;
    }

    void setThreadName(std::thread* thread, const char* threadName) {
        auto handle = thread->native_handle();
        pthread_setname_np(handle, threadName);
    }

    void createDirectory(const char* path) {
        return mkdir(path, 0777) == 0;
    }

    #include <sys/prctl.h>
    void setThreadName(const char* threadName) {
        prctl(PR_SET_NAME, threadName, 0, 0, 0);
    }
}; //namespace Divide

#endif //defined(_UNIX)

Commits for Divide-Framework/trunk/Source Code/Platform/PlatformDefinesUnix.cpp

Diff revisions: vs.
Revision Author Commited Message
832 Diff Diff IonutCava picture IonutCava Thu 26 Jan, 2017 17:23:11 +0000

[IonutCava]
- More path related work
- Initial code to centralize file I/O (does not compile yet)

830 Diff Diff IonutCava picture IonutCava Wed 25 Jan, 2017 17:29:44 +0000

[IonutCava]
- Add a new Platform element: File
— Move all predefined paths to FileManagement System
- Split MathHelper into MathHelper and StringHelper

783 Diff Diff IonutCava picture IonutCava Fri 14 Oct, 2016 15:50:34 +0000

[IonutCava]
- More cleanup of the Frustum class
- Change random number generation system to use the C++11 <random> features. (default engine set to Mersenne Twister and using a uniform distribution as default)

768 Diff Diff IonutCava picture IonutCava Fri 09 Sep, 2016 14:38:51 +0000

[IonutCava]
- Refactored framework entry points (init, step, shutdown) to allow the addition of hot code reloading in the future

758 Diff Diff IonutCava picture IonutCava Tue 02 Aug, 2016 16:05:09 +0000

[IonutCava]
- Added a cross platform method of naming threads (helps with debugging)
- Reduced dependency on VAR.dvd_drawID in shaders.
- Work on Single/Multi thread toggle for GFX resource loading (crashes, bugs, etc)
- Fix a bug in TaskPool where task states were never actually updated properly
- Change threadpool implementation to use std::thread instead of boost::thread

686 Diff Diff IonutCava picture IonutCava Thu 21 Apr, 2016 16:24:19 +0000

[IonutCava]
- Refactor the scene self-registering system to prevent linker related issues
- Add a SGNRelationshipCache class that can quickly verify if any 2 given nodes are related in any way
— This should speed up Octree updates by a lot

note: The template refactoring code has significantly slowed down performance for reasons yet unknown. Investigating.

660 Diff Diff IonutCava picture IonutCava Mon 21 Mar, 2016 17:11:19 +0000

[IonutCava]
- Finish Parent<->Children thread pool system
- Use new thread pool system for most multithreaded tasks in the engine: culling, sorting, light preparation, etc
- Add platform specific init/close calls at the start and end of the main function for future use

540 Diff Diff IonutCava picture IonutCava Wed 28 Oct, 2015 19:06:28 +0000

[IonutCava]
- Remove the “Platform” folder from the Platform project as the name is redundant. Move files one level up

489 Diff Diff IonutCava picture IonutCava Wed 12 Aug, 2015 19:44:53 +0000

[Ionut]
- Replace platform specific timing code with C++11’s new std::chrono library for better cross platform compatibility, performance and reliability (hopefully)

464 IonutCava picture IonutCava Thu 04 Jun, 2015 16:07:22 +0000

[Ionut]
- Linux port work:
— Improved timing code
— Split solution in 3 projects: Divide-Game, Divide-Networking, Divide-Server all in a single working set.
- Fixed OpenGL context creation fail message