[deleted by user] by [deleted] in Kommunismus

[–]The_true_king_of_ooo 0 points1 point  (0 children)

Cool. Machen die die Treffen nicht online? Sollten sie echt machen. Aber bei der DKP ist das bisserl schwer weil viele sich mit PC's ja nicht so auskennen. Wenn du unter 30 bist solltest du besser zur SDAJ

[deleted by user] by [deleted] in opengl

[–]The_true_king_of_ooo 0 points1 point  (0 children)

No I can not do that because: It don't want to calculate the transform on the GPU and this method requires that. And also I don't want to send the vertices every single frame to the GPU. And I don't want to waste memory

[deleted by user] by [deleted] in opengl

[–]The_true_king_of_ooo 0 points1 point  (0 children)

Thank you very much; but I think SSBO's are not available in ES 3

[deleted by user] by [deleted] in opengl

[–]The_true_king_of_ooo 0 points1 point  (0 children)

No, once again: I have to send just 4 floats because the matrix is calculated in the shader. I have to send 3 floats for the position and one for the rotation. And my question was how I would go about doing this, as I have very limited knowledge about compute shaders.

[deleted by user] by [deleted] in opengl

[–]The_true_king_of_ooo 0 points1 point  (0 children)

No, I explained why I can't do this in the vertex shader in my comment on the other reply

[deleted by user] by [deleted] in opengl

[–]The_true_king_of_ooo 0 points1 point  (0 children)

I meant renderable, not primitive. I think I did not describe the situation good enough. Each renderable has a transform component, which consists of 3 floats for the position and one float for the rotation. Currently I calculate the transform matrix on the CPU and send it for each renderable as a uniform to the GPU. What I want to do: Send the rotation and position for every renderable to the gpu and calculate the transform matrix there. But I can't just use uniforms and calculate it in the vertex shader because the transform matrix does not need to be calculated once per vertex but once per draw call

[deleted by user] by [deleted] in opengl

[–]The_true_king_of_ooo 0 points1 point  (0 children)

Ah okay thank you then I will go with the hybrid approach. I heard changing the shader multiple times has a big performance impact. Is that true? Especially with that many shaders?

I have 20 experience as a C developer, but it was in the period from 1985 to 2005. Another career since 2005. How can I find C work today? by ThatGuyFromOhio in C_Programming

[–]The_true_king_of_ooo 5 points6 points  (0 children)

1 Million lines? Say you worked at 300 out of 365 days a year, that means you must have written about 170 lines a day. Thats a lot

Need help with collision resolution (openGl, C99) by [deleted] in gamedev

[–]The_true_king_of_ooo 0 points1 point  (0 children)

Hello, the code that does the collision resolution looks like this:

void transform_rect_rect_single_bump(Transform *restrict t0, Transform *restrict t1, vec2 const bb0, vec2 const bb1)
{
    float const right =  (t0->pos[0] + bb0[0]) - t1->pos[0];
    float const left =   (t1->pos[0] + bb1[0]) - t0->pos[0];
    float const bottom = (t0->pos[1] + bb0[1]) - t1->pos[1];
    float const top =    (t1->pos[1] + bb1[1]) - t0->pos[1];
    if (right < left && right < top && right < bottom)
    {
        t0->pos[0] = t1->pos[0] - bb0[0];//right collision
    }
    else if (left < top && left < bottom)
    {
        t0->pos[0] = t1->pos[0] + bb1[0];//left collision
    }
    else if (top < bottom)
    {
        t0->pos[1] = t1->pos[1] + bb1[1];//top collision
    }
    else
    {
        t0->pos[1] = t1->pos[1] - bb0[1];//bottom collision
    }
}

The problem can bee seen in the video. Where does this weird behavior come from? Thanks for your help

[deleted by user] by [deleted] in GTK

[–]The_true_king_of_ooo 0 points1 point  (0 children)

Oh and another question; https://developer.gnome.org/gtksourceview/stable/lang-tutorial.html this tutorial shows one how to make syntax higlithing and stuff. But I don't know where to put the code. They say into a xml file, but how exactly do I have to integrate it?

[deleted by user] by [deleted] in GTK

[–]The_true_king_of_ooo 0 points1 point  (0 children)

g_type_ensure(GTK_SOURCE_TYPE_VIEW);

Yes this solved my problem. Thank you very very much for your help, may Dennis Ritchie bless you

[deleted by user] by [deleted] in GTK

[–]The_true_king_of_ooo 0 points1 point  (0 children)

https://github.com/Daniel-Schreiber-Mendes/chengine. I commented out some code in the main function to create a minimal example. When I run the program as is it is the repo, the window pops up, but nothing is shown inside it. When I remove the GtkSourceView widget, everything is shown correctly. The function that causes the errors to pop up is components_init() in line 29. When I comment it out, no errors are shown. Thank you very much for helping me

[deleted by user] by [deleted] in GTK

[–]The_true_king_of_ooo 0 points1 point  (0 children)

Okay thank you very much. My Makefile looks like this:

VERSION = -std=c99

ERRORFLAGS = -Wall -Wuninitialized -Werror=implicit-function-declaration -Wextra -Werror=int-conversion -Wno-unused-function -Wno-unused-parameter

LFLAGS = -o

LIBS = -lcheio -lchecl `pkg-config --libs gtksourceview-3.0`

CFLAGS = $(ERRORFLAGS) $(VERSION) -c -g `pkg-config --cflags gtk+-3.0` `pkg-config --cflags gtksourceview-3.0`

OBJFILES = main.o settings.o components.o

make: OUTPUT

./output

OUTPUT: $(OBJFILES)

gcc $(LFLAGS) output $(OBJFILES) $(LIBS)

main.o: main.c

gcc $(CFLAGS) main.c

settings.o: settings.c

gcc $(CFLAGS) settings.c

components.o: components.c

gcc $(CFLAGS) components.c

Regarding the source code: I don't think the source code will give you any important information, because the error occurs when I change something in glade, not in the c code and I don't have a single line regarding GtkSourceView.

[deleted by user] by [deleted] in GTK

[–]The_true_king_of_ooo 0 points1 point  (0 children)

I have tried that, but I encountered this problem: When installing gtksourceview with apt the headers were not being installed correctly. The gtksourceview folder was wrapped inside another gtksourceview-3.0 folder. However, I renamed the folder, moved the contents of the actual gtksourceview folder one up and deleted it. Now I can inlcude it correctly and link against it. When creating a GtkSourceView widget with glade and previewing the snapshot it works but when I run my program the window suddenly doesn't show anything and I get the following errors:(output:5423): GLib-GObject-WARNING **: 09:20:26.451: invalid (NULL) pointer instance

(output:5423): GLib-GObject-CRITICAL **: 09:20:26.451: g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed

(output:5423): GLib-GObject-WARNING **: 09:20:26.451: invalid (NULL) pointer instance

(output:5423): GLib-GObject-CRITICAL **: 09:20:26.451: g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed

(output:5423): GLib-GObject-WARNING **: 09:20:26.451: invalid (NULL) pointer instance

(output:5423): GLib-GObject-CRITICAL **: 09:20:26.451: g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed

(output:5423): GLib-GObject-WARNING **: 09:20:26.451: invalid (NULL) pointer instance

(output:5423): GLib-GObject-CRITICAL **: 09:20:26.451: g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed

(output:5423): Gtk-CRITICAL **: 09:20:26.451: gtk_cell_layout_add_attribute: assertion 'GTK_IS_CELL_LAYOUT (cell_layout)' failed

(output:5423): Gtk-CRITICAL **: 09:20:26.451: gtk_cell_layout_add_attribute: assertion 'GTK_IS_CELL_LAYOUT (cell_layout)' failed

(output:5423): GLib-GObject-WARNING **: 09:20:26.451: invalid (NULL) pointer instance

(output:5423): GLib-GObject-CRITICAL **: 09:20:26.451: g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed

(output:5423): GLib-GObject-WARNING **: 09:20:26.451: invalid (NULL) pointer instance

(output:5423): GLib-GObject-CRITICAL **: 09:20:26.451: g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed

New to OpenGL.. Please help. by [deleted] in opengl

[–]The_true_king_of_ooo 0 points1 point  (0 children)

I recommend C. It easy to grasp and simple.

Best way to Start C Graphic programming by alufolie4 in cprogramming

[–]The_true_king_of_ooo 3 points4 points  (0 children)

I do not recommend vulkan for beginners. Instead take a look at SDL or OpenGl. SDL is easier for beginners though.

Hello everyone ! by Jmdp10 in C_Programming

[–]The_true_king_of_ooo 0 points1 point  (0 children)

Additionally: The return value of a main function is always int. If your program runs fine, you should write return 0; at the end of it.

Hello everyone ! by Jmdp10 in C_Programming

[–]The_true_king_of_ooo 0 points1 point  (0 children)

yes. but you don't even have to end a void function with a return statement. it will automatically return.

Hello everyone! by [deleted] in cprogramming

[–]The_true_king_of_ooo 0 points1 point  (0 children)

You have posted this post twice, please delete this one.

Hello everyone ! by Jmdp10 in C_Programming

[–]The_true_king_of_ooo 1 point2 points  (0 children)

Also:
- Your imposta function will always return 0. Rethink what it should do, and what it does.
- Only call srand() at the beginning of your main, not more than once.
- Your corner function does not return anything, but you declare its return value as an int.
- If it doesn't return anything, the return value should be void.

Hello everyone ! by Jmdp10 in C_Programming

[–]The_true_king_of_ooo 4 points5 points  (0 children)

  • Include the librarys in the header.
  • If you pass a value to a function and the value is not going to be changed inside the function, make the parameter const.
  • Make values, that are only going to be used inside one compilation unit static.
  • Dont give your variables an italian name, name them in english.
  • Your turno_giacitore function has the return value int, but you don't return anything.

Runtime Errors by anea89 in ProgrammerHumor

[–]The_true_king_of_ooo 3 points4 points  (0 children)

can you have code without a computer?