Jump to content

Robert_d1968

Members
  • Posts

    82
  • Joined

  • Last visited

Posts posted by Robert_d1968

  1. So now, my programs name is Ultra App Kit instead of Ultra Engine.

    Are you merging them?

     

    Robert

    PS. is there any game made with this as of yet? If so I would like to see some source code as I learn faster from that.

     

  2. What is with Visual C++? there is no object oriented window in the program that I can find... 

    I about ready to create libraries in XOJO to support my programming in Xojo  it is object oriented programming in ever aspect of it.

    This way I can make cool games with it.

    Robert

    • Confused 1
  3. when I place the code here:

     while (true)
        {

            auto err = glGetError();
            if (err != 0) Print(err);

            //Check for events
            const Event ev = WaitEvent();
            switch (ev.id)
            {
            case EVENT_WINDOWPAINT:
                if (ev.source == subwindow)
                {
                    iVec2 sz = subwindow->ClientSize();
                    glViewport(0, 0, sz.x, sz.y);
                    glClearColor(0.15f, 0.15f, 0.15f, 1.0f);
                    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

                    glBegin(GL_TRIANGLES);
                    glColor3f(1, 0, 0);
                    glVertex3f(0, 0.5, 0);
                    glColor3f(0, 1, 0);
                    glVertex3f(0.5, -0.5, 0);
                    glColor3f(0, 0, 1);
                    glVertex3f(-0.5, -0.5, 0);
                    glEnd();
                    auto err = glGetError();
                   // if (err != 0) Print(err);
                   // SwapBuffers(hdc);             
                }
                break;
            case EVENT_WINDOWCLOSE:
                if (ev.source == window) return 0;
                break;
            }
        }
        return 0;
    }

     

    I get nothing in the console and nothing printed where the graphics should be drawn.

    Robert

     

  4. This was the code from it:

     

    #include "UltraEngine.h"

    using namespace UltraEngine;

    #include <GL/GL.h>
    #pragma comment (lib, "opengl32.lib")


    bool ResizeViewport(const Event& ev, shared_ptr<Object> extra)
    {
        if (ev.id == EVENT_WINDOWSIZE)
        {
            auto window = ev.source->As<Window>();
            iVec2 sz = window->ClientSize();
            auto subwindow = extra->As<Window>();
            subwindow->SetShape(200 + 1, 8 + 1, sz.x - 200 - 8 - 2, sz.y - 16 - 2);
        }
        return true;
    }

    int main(int argc, const char* argv[])
    {
        //Get the available displays
        auto displays = ListDisplays();

        //Create a window
        auto window = CreateWindow("OpenGL Example", 0, 0, 800, 600, displays[0], WINDOW_TITLEBAR | WINDOW_RESIZABLE);

        //Create user interface
        auto ui = CreateInterface(window);
        iVec2 sz = ui->root->ClientSize();
        auto treeview = CreateTreeView(8, 8, 200 - 16, sz.y - 16, ui->root);
        treeview->SetLayout(1, 0, 1, 1);
        treeview->root->AddNode("Object 1");
        treeview->root->AddNode("Object 2");
        treeview->root->AddNode("Object 3");

        auto panel = CreatePanel(200, 8, sz.x - 200 - 8, sz.y - 16, ui->root, PANEL_BORDER);
        panel->SetLayout(1, 1, 1, 1);
        panel->SetColor(0.15, 0.15, 0.15, 1);

        //Create viewport window
        auto subwindow = CreateWindow("", 200 + 1, 8 + 1, sz.x - 200 - 8 - 1, sz.y - 16 - 1, window, WINDOW_CHILD);

        //Adjust the viewport size when main window resized
        ListenEvent(EVENT_WINDOWSIZE, window, ResizeViewport, subwindow);

        //Initialize OpenGL context
        HWND hwnd = subwindow->GetHandle();
        HDC hdc = GetDC(hwnd);

        PIXELFORMATDESCRIPTOR pfd =
        {
            sizeof(PIXELFORMATDESCRIPTOR),
            1,
            PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER,    // Flags
            PFD_TYPE_RGBA,        // The kind of framebuffer. RGBA or palette.
            32,                   // Colordepth of the framebuffer.
            0, 0, 0, 0, 0, 0,
            0,
            0,
            0,
            0, 0, 0, 0,
            24,                   // Number of bits for the depthbuffer
            8,                    // Number of bits for the stencilbuffer
            0,                    // Number of Aux buffers in the framebuffer.
            PFD_MAIN_PLANE,
            0,
            0, 0, 0
        };

        if (SetPixelFormat(hdc, 1, &pfd) == 0) RuntimeError("SetPixelFormat() failed.");

        HGLRC glcontext = wglCreateContext(hdc);

        if (glcontext == NULL) RuntimeError("wglCreateContext() failed.");

        wglMakeCurrent(hdc, glcontext);

        while (true)
        {
            //Check for events
            const Event ev = WaitEvent();
            switch (ev.id)
            {
            case EVENT_WINDOWPAINT:
                if (ev.source == subwindow)
                {
                    iVec2 sz = subwindow->ClientSize();
                    glViewport(0, 0, sz.x, sz.y);
                    glClearColor(0.15f, 0.15f, 0.15f, 1.0f);
                    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

                    glBegin(GL_TRIANGLES);
                    glColor3f(1, 0, 0);
                    glVertex3f(0, 0.5, 0);
                    glColor3f(0, 1, 0);
                    glVertex3f(0.5, -0.5, 0);
                    glColor3f(0, 0, 1);
                    glVertex3f(-0.5, -0.5, 0);
                    glEnd();

                    SwapBuffers(hdc);
                }
                break;
            case EVENT_WINDOWCLOSE:
                if (ev.source == window) return 0;
                break;
            }
        }
        return 0;
    }

  5. Well, the first top half of the code produced a whit colored box. seems to be okay.

    But the second box from the code below produced a darker colored box, with three objects to be clicked on.

    No matter which one I clicked, nothing was drawn to the screen.

    Robert

  6. "if you have the "inherit from project defaults..." option selected. So you are right, you must select the option "optimized for sharing blah blah blah..."."

    I can't seem to find the "inherit from project defaults..." option where is that located?

    Robert

  7. I now have installed 16.9.2 of Visual C++

    after I start debug and then stop, I get this code on the output.. Some things did not load.

    'OpenGL1_d.exe' (Win32): Loaded 'C:\Users\Robert\Documents\Ultra Engine\Projects\OpenGL1\OpenGL1_d.exe'. Symbols loaded.
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\ntdll.dll'. 
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\kernel32.dll'. 
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\KernelBase.dll'. 
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\user32.dll'. 
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\win32u.dll'. 
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\gdi32.dll'. 
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\gdi32full.dll'. 
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\msvcp_win.dll'. 
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\ucrtbase.dll'. 
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\comdlg32.dll'. 
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\msvcrt.dll'. 
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\combase.dll'. 
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\rpcrt4.dll'. 
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\SHCore.dll'. 
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\shlwapi.dll'. 
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\shell32.dll'. 
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_5.82.19041.844_none_423537bff6b9828c\comctl32.dll'. 
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\ole32.dll'. 
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\advapi32.dll'. 
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\sechost.dll'. 
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\msimg32.dll'. 
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\dwmapi.dll'. 
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\winmm.dll'. 
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\urlmon.dll'. 
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\WinSxS\amd64_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.19041.789_none_faf0a7e97612e7bb\GdiPlus.dll'. 
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\opengl32.dll'. 
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\iertutil.dll'. 
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\glu32.dll'. 
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\imm32.dll'. 
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\uxtheme.dll'. 
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\msctf.dll'. 
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\oleaut32.dll'. 
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Program Files\WIDCOMM\Bluetooth Software\BtMmHook.dll'. 
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\psapi.dll'. 
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\kernel.appcore.dll'. 
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\bcryptprimitives.dll'. 
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\TextInputFramework.dll'. 
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\CoreUIComponents.dll'. 
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\CoreMessaging.dll'. 
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\ws2_32.dll'. 
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\ntmarta.dll'. 
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\WinTypes.dll'. 
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\WinTypes.dll'. 
    'OpenGL1_d.exe' (Win32): Unloaded 'C:\Windows\System32\WinTypes.dll'
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\TextShaping.dll'. 
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\windows.storage.dll'. 
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\wldp.dll'. 
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\DriverStore\FileRepository\nvdmi.inf_amd64_774120bbcad3ef2b\nvdlistx.dll'. 
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\version.dll'. 
    'OpenGL1_d.exe' (Win32): Unloaded 'C:\Windows\System32\version.dll'
    'OpenGL1_d.exe' (Win32): Unloaded 'C:\Windows\System32\DriverStore\FileRepository\nvdmi.inf_amd64_774120bbcad3ef2b\nvdlistx.dll'
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\clbcatq.dll'. 
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\AppXDeploymentClient.dll'. 
    'OpenGL1_d.exe' (Win32): Unloaded 'C:\Windows\System32\AppXDeploymentClient.dll'
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\DriverStore\FileRepository\nvdmi.inf_amd64_774120bbcad3ef2b\nvoglv64.dll'. 
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\setupapi.dll'. 
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\cfgmgr32.dll'. 
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\bcrypt.dll'. 
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\version.dll'. 
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\wtsapi32.dll'. 
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\devobj.dll'. 
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\wintrust.dll'. 
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\crypt32.dll'. 
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\msasn1.dll'. 
    The thread 0x2728 has exited with code 0 (0x0).
    The thread 0x300c has exited with code 0 (0x0).
    The thread 0x2f24 has exited with code 0 (0x0).
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\DXCore.dll'. 
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\nvspcap64.dll'. 
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\profapi.dll'. 
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\powrprof.dll'. 
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\umpdc.dll'. 
    'OpenGL1_d.exe' (Win32): Loaded 'C:\Windows\System32\winsta.dll'. 
    The thread 0x33e0 has exited with code 0 (0x0).
    The thread 0xfc8 has exited with code 0 (0x0).
    The thread 0x1c58 has exited with code 0 (0x0).
    The thread 0x1c80 has exited with code 0 (0x0).
    The thread 0x40c0 has exited with code 0 (0x0).
    The thread 0x3f4c has exited with code 0 (0x0).
    The thread 0x21d0 has exited with code 0 (0x0).
    The thread 0x26e0 has exited with code 0 (0x0).
    The thread 0x1cac has exited with code 0 (0x0).
    The thread 0x2b5c has exited with code 0 (0x0).
    The thread 0x380c has exited with code 0 (0x0).
    The program '[15084] OpenGL1_d.exe' has exited with code 0 (0x0).
     

  8. "As a solution I would recommend changing your debugging configuration settings to /DEBUG:FULL. You can do this by right-clicking your project in Visual Studio and then going to:

    Linker > Debugging > Generate Debug Info > /DEBUG:FULL"

     

    Hmm, I still can't find it... Exactly what needs to be clicked on on the project?  

    Thanks for your help,

    Robert

×
×
  • Create New...