Giter VIP home page Giter VIP logo

clanlib's People

Contributors

anonymouscommitter avatar arthome12 avatar authenticate avatar bmwiedemann avatar devilwithhorn avatar doughdemon avatar dpjudas avatar fccm avatar gpmfuchs avatar grizmu avatar henu avatar jeremycochoy avatar jherman3 avatar kapulkin avatar keigen-shu avatar lethalghost avatar linuxkid21 avatar meihouwang avatar pyrdacor avatar rombust avatar roothorick avatar sphair avatar suexec avatar vanillajonathan avatar xantares avatar xctan avatar xottab-duty avatar zhangwenlong8911 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

clanlib's Issues

Old versions

Where can one get old versions of clanlib like 1.x or 2.x? Thanks.

Sus GL3ShaderObjectProvider::create()

In https://github.com/sphair/ClanLib/blob/master/Sources/GL/GL3/gl3_shader_object_provider.cpp

The following code is suspect. Nothing deletes array_sources and array_source_lengths (excluding the caught exception)
In addition, Visual Studio code analysis says "Buffer overrun while writing to array_source_length" in the for loop, but it all looks good to me

	GLchar ** array_sources = nullptr;
	GLint *array_source_lengths = nullptr;
	try
	{
		array_sources = new GLchar*[sources.size()];
		array_source_lengths = new GLint[sources.size()];
		for (std::vector<std::string>::size_type i = 0; i < sources.size(); i++)
		{
			array_source_lengths[i] = sources[i].length();
			array_sources[i] = (GLchar*)sources[i].c_str();
		}
		glShaderSource(handle, sources.size(), (const GLchar**)array_sources, array_source_lengths);
	}
	catch (...)
	{
		delete[] array_source_lengths;
		delete[] array_sources;
		throw;
	}

License

Hello, Can I move without any change ClanLib's RSA class and dependencies to my project, Does it support ClanLib's license or can i use it only as static lib?

Using clan::Path with OpenGL on Intel GPUs

Using clan::Path to draw a rounded box does not work with OpenGL on an Intel GPU

PXL_20240108_114025355

The issue is caused with the clan::Path internals incorrectly uploading the graphics. The completion status of texture upload that's using previous cached transfer buffers is not checked. Thus we are modifying the buffer before the previous buffer was uploaded

It works using the Direct3D target. It works on all targets with Nvidia GPU's

The fix is to not cache transfer buffers, and instead recreate them.
See patch
patch.txt

Linux Audio

Is anyone else having problems with clanSound on Linux? It doesn't play any audio on my Linux Mint.

Tested with Examples/Sound/Sound.

clan::GameTime fault

There is an issue with clan::GameTime.
If you sum 30 seconds of samples from GameTime::get_time_elapsed_ms(), this does not equal GameTime::get_current_time_ms()

Demonstrated by:

    game_time.update();
    static int total = 0;
    total += game_time.get_time_elapsed_ms();
    printf("%d\n", (int) ( game_time.get_current_time_ms() - total));

There is a fault with the usage of time_elapsed_ms_microsecond_adjustment.

This can be trivially fixed by having a "updated_current_time_ms" variable and the elapsed time is the delta from before it was set.

Unfortunately I currently don't have time to fix it.

can't compile Examples/Display_Render/MapMode

i can't compile the MapMode example. it fails with

g++ -I Sources -I ./ pkg-config --cflags clanApp-4.1 clanDisplay-4.1 clanCore-4.1 clanGL-4.1 clanUI-4.1 -pthread -c Sources/options.cpp -o Sources/options.o
g++ -I Sources -I ./ pkg-config --cflags clanApp-4.1 clanDisplay-4.1 clanCore-4.1 clanGL-4.1 clanUI-4.1 -pthread -c Sources/app.cpp -o Sources/app.o
g++ -I Sources -I ./ pkg-config --cflags clanApp-4.1 clanDisplay-4.1 clanCore-4.1 clanGL-4.1 clanUI-4.1 -pthread -c ../../ThemeAero/Sources/theme.cpp -o ../../ThemeAero/Sources/theme.o
../../ThemeAero/Sources/theme.cpp: In static member function ‘static std::shared_ptrclan::ListBoxView Theme::create_listbox()’:
../../ThemeAero/Sources/theme.cpp:237:55: error: cannot bind non-const lvalue reference of type ‘std::shared_ptrclan::ScrollBarView&’ to an rvalue of type ‘std::shared_ptrclan::ScrollBarView’
237 | initialize_scrollbar(listbox->scrollbar_x_view(), true);
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~
../../ThemeAero/Sources/theme.cpp:52:72: note: initializing argument 1 of ‘static void Theme::initialize_scrollbar(std::shared_ptrclan::ScrollBarView&, bool)’
52 | void Theme::initialize_scrollbar(std::shared_ptrclan::ScrollBarView &scrollbar, bool isHorizontal)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
../../ThemeAero/Sources/theme.cpp:238:55: error: cannot bind non-const lvalue reference of type ‘std::shared_ptrclan::ScrollBarView&’ to an rvalue of type ‘std::shared_ptrclan::ScrollBarView’
238 | initialize_scrollbar(listbox->scrollbar_y_view(), false);
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~
../../ThemeAero/Sources/theme.cpp:52:72: note: initializing argument 1 of ‘static void Theme::initialize_scrollbar(std::shared_ptrclan::ScrollBarView&, bool)’
52 | void Theme::initialize_scrollbar(std::shared_ptrclan::ScrollBarView &scrollbar, bool isHorizontal)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
make: *** [../../Makefile.conf:23: ../../ThemeAero/Sources/theme.o] Error 1`

g++ 11.2.0 is used

Property DisplayWindowDescription.is_topmost() does not work on Mac OS

The code below creates window, which is not always on top

`

// Set the window description
clan::DisplayWindowDescription desc_window;
desc_window.set_title("Motion Learning");
desc_window.set_topmost();
desc_window.set_popup_window();
desc_window.set_allow_resize(false);
desc_window.set_layered(true);
desc_window.show_caption(false);
desc_window.set_size(clan::Size(1792, 828), false);

// Open the windows
window = clan::DisplayWindow(desc_window);

`

Assessment of the difficulty in porting CPU architecture for clanlib

Hello everyone! I am working on implementing a tool to assess the complexity of CPU architecture porting. It primarily focuses on RISC-V architecture porting. In fact, the tool may have an average estimate of various architecture porting efforts.My focus is on the overall workload and difficulty of transplantation in the past and future,even if a project has already been ported.As part of my dataset, I have collected the clanlib project. I would like to gather community opinions to support my assessment. I appreciate your help and response! Based on scanning tools, the porting complexity is determined to be simple, with a small amount of code related to the CPU architecture in the project. Is this assessment accurate?Do you have any opinions on personnel allocation and consumption time? I look forward to your help and response.

Clanlib fails to build on aarch64

Clanlib 4.1.0 fails to build on aarch64.
Error log:

[  183s] System/detect_cpu_ext.cpp: In function 'detect_cpu_extension':
[  183s] System/detect_cpu_ext.cpp:81:4: error: impossible constraint in 'asm'
[  183s]    81 |    __cpuid((int*)cpuinfo, 0x1);
[  183s]       |    ^
[  183s] System/detect_cpu_ext.cpp:86:4: error: impossible constraint in 'asm'
[  183s]    86 |    __cpuid((int*)cpuinfo, 0x80000000);
[  183s]       |    ^
[  183s] System/detect_cpu_ext.cpp:90:4: error: impossible constraint in 'asm'
[  183s]    90 |    __cpuid((int*)cpuinfo, 0x80000001);
[  183s]       |    ^
[  183s] System/detect_cpu_ext.cpp:95:4: error: impossible constraint in 'asm'
[  183s]    95 |    __cpuid((int*)cpuinfo, 0x80000000);
[  183s]       |    ^
[  183s] System/detect_cpu_ext.cpp:99:4: error: impossible constraint in 'asm'
[  183s]    99 |    __cpuid((int*)cpuinfo, 0x80000001);
[  183s]       |    ^
[  183s] System/detect_cpu_ext.cpp:104:4: error: impossible constraint in 'asm'
[  183s]   104 |    __cpuid((int*)cpuinfo, 0x80000000);
[  183s]       |    ^
[  183s] System/detect_cpu_ext.cpp:108:4: error: impossible constraint in 'asm'
[  183s]   108 |    __cpuid((int*)cpuinfo, 0x80000001);
[  183s]       |    ^
[  183s] System/detect_cpu_ext.cpp:113:4: error: impossible constraint in 'asm'
[  183s]   113 |    __cpuid((int*)cpuinfo, 0x1);
[  183s]       |    ^
[  183s] System/detect_cpu_ext.cpp:118:4: error: impossible constraint in 'asm'
[  183s]   118 |    __cpuid((int*)cpuinfo, 0x1);
[  183s]       |    ^
[  183s] System/detect_cpu_ext.cpp:123:4: error: impossible constraint in 'asm'
[  183s]   123 |    __cpuid((int*)cpuinfo, 0x1);
[  183s]       |    ^
[  183s] System/detect_cpu_ext.cpp:128:4: error: impossible constraint in 'asm'
[  183s]   128 |    __cpuid((int*)cpuinfo, 0x1);
[  183s]       |    ^
[  183s] System/detect_cpu_ext.cpp:134:4: error: impossible constraint in 'asm'
[  183s]   134 |    __cpuid((int*)cpuinfo, 0x80000000);
[  183s]       |    ^
[  183s] System/detect_cpu_ext.cpp:138:4: error: impossible constraint in 'asm'
[  183s]   138 |    __cpuid((int*)cpuinfo, 0x80000001);
[  183s]       |    ^
[  183s] System/detect_cpu_ext.cpp:143:4: error: impossible constraint in 'asm'
[  183s]   143 |    __cpuid((int*)cpuinfo, 0x1);
[  183s]       |    ^
[  183s] System/detect_cpu_ext.cpp:148:4: error: impossible constraint in 'asm'
[  183s]   148 |    __cpuid((int*)cpuinfo, 0x1);
[  183s]       |    ^
[  183s] System/detect_cpu_ext.cpp:153:4: error: impossible constraint in 'asm'
[  183s]   153 |    __cpuid((int*)cpuinfo, 0x80000000);
[  183s]       |    ^
[  183s] System/detect_cpu_ext.cpp:157:4: error: impossible constraint in 'asm'
[  183s]   157 |    __cpuid((int*)cpuinfo, 0x80000001);
[  183s]       |    ^
[  183s] System/detect_cpu_ext.cpp:162:4: error: impossible constraint in 'asm'
[  183s]   162 |    __cpuid((int*)cpuinfo, 0x1);
[  183s]       |    ^
[  183s] System/detect_cpu_ext.cpp:167:4: error: impossible constraint in 'asm'
[  183s]   167 |    __cpuid((int*)cpuinfo, 0x1);
[  183s]       |    ^
[  183s] System/detect_cpu_ext.cpp:172:4: error: impossible constraint in 'asm'
[  183s]   172 |    __cpuid((int*)cpuinfo, 0x1);
[  183s]       |    ^
[  183s] System/detect_cpu_ext.cpp:177:4: error: impossible constraint in 'asm'
[  183s]   177 |    __cpuid((int*)cpuinfo, 0x80000000);
[  183s]       |    ^
[  183s] System/detect_cpu_ext.cpp:181:4: error: impossible constraint in 'asm'
[  183s]   181 |    __cpuid((int*)cpuinfo, 0x80000001);
[  183s]       |    ^

Remake `IODevice` from `int` to `size_t`

IODevice is written in С 32bits style with int to use for indicate the amounts instead size_t, to return -1 as error. It still works but not safety on a 64-bit architecture.

I would like to hear the developers' opinion - will accepted the commit that change int to size_t and -1 to SIZE_MAX?

Rejection of imp->

In the clanlib's architecture is widely practiced that behind the class there is an implementation. This speeds up the compilation of the library itself at the expense of the optimality of the final code. Is it generally justified for libraries?

Too complicated build system

According to this code:

#include <ClanLib/core.h>

We should move Sources/API dir to include/ClanLib dir. With this change we can build project that depend on ClanLib out of the box without doing anything. This will make compilation significantly easier.

Without it we should configure it with configure.exe before (if we don't then we'll fail to build)

I can make a PR with it. I just need to know what I need to change additionally, since it seems that just moving the folder is not enough. (we should change the build scripts)

Border style unfinished

The library understands separate styles for the top, right, bottom and left lines of the border, different types of fill (groove, ridge, etc.), but the drawing is implemented primitively - the same as top border and only solid.
The existing code of Sources\UI\Style\style_background_renderer.cpp:

	void StyleBackgroundRenderer::render_border()
	{
		int num_layers = style.array_size("background-image");
		if (!get_layer_clip(num_layers - 1).is_keyword("border-box"))
			return;

		StyleGetValue style_top = style.computed_value("border-top-style");
		if (style_top.is_keyword("solid"))
		{
			Colorf color = style.computed_value("border-top-color").color();
			if (color.a > 0.0f)
			{
				auto border_points = get_border_points();
				auto padding_points = get_padding_points(border_points);
				Path border_path = get_border_stroke_path(border_points, padding_points);
				border_path.fill(canvas, Brush(color));
			}
		}
	}

It is necessary to implement:

  • separate border drawing (top, left, right, bottom);
  • support for all styles (thin, medium, thick, dotted, dashed, double, groove, ridge, inset, outset).

Maybe someone has already done this in his code and just need to copy-paste?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.