User Tag List

Results 1 to 10 of 49

Thread: Next Gen ZC. (Otherwise known as ZC3.0)

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Keese Samer's Avatar
    Join Date
    Jan 2015
    Location
    Detroit, MI
    Age
    32
    Posts
    66
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    517
    Level
    8
    vBActivity - Bars
    Lv. Percent
    15.84%
    Mostly to Gleeok but could apply to everyone
    @Gleeok
    I'm really not trying to be offensive, just spreading knowledge.

    Data structures and OOP are one in the same. OOP is just organization. Here's an example program I was using myself with a team for a university project for software change requests.
    https://github.com/Gr1N/EasyPaint

    The implementation for classes (data structure) is still data-oriented but designed in a way to improve stability and balance, speed is important but you'd be better off writing everything in assembly if that's your main goal.

    The classes used for drawing graphics and memory management can still be data-oriented, but encapsulated.

  2. #2
    The Time-Loop Continues ZC Developer
    Gleeok's Avatar
    Join Date
    Apr 2007
    Posts
    4,826
    Mentioned
    259 Post(s)
    Tagged
    10 Thread(s)
    vBActivity - Stats
    Points
    12,961
    Level
    33
    vBActivity - Bars
    Lv. Percent
    26.43%
    Quote Originally Posted by Samer View Post
    Mostly to Gleeok but could apply to everyone
    @Gleeok
    I'm really not trying to be offensive, just spreading knowledge.
    And I'm really sorry I even brought up concerns about the performance of drawing tiles and maps in Solarus.

    I only did so because I know how it works internally.

    From SDL 2.03 source:
    Code:
    static int
    GL_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
                  const SDL_Rect * srcrect, const SDL_FRect * dstrect)
    {
        GL_RenderData *data = (GL_RenderData *) renderer->driverdata;
        GL_TextureData *texturedata = (GL_TextureData *) texture->driverdata;
        GLfloat minx, miny, maxx, maxy;
        GLfloat minu, maxu, minv, maxv;
    
        GL_ActivateRenderer(renderer);
    
        data->glEnable(texturedata->type);
        if (texturedata->yuv) {
            data->glActiveTextureARB(GL_TEXTURE2_ARB);
            data->glBindTexture(texturedata->type, texturedata->vtexture);
    
            data->glActiveTextureARB(GL_TEXTURE1_ARB);
            data->glBindTexture(texturedata->type, texturedata->utexture);
    
            data->glActiveTextureARB(GL_TEXTURE0_ARB);
        }
        data->glBindTexture(texturedata->type, texturedata->texture);
    
        if (texture->modMode) {
            GL_SetColor(data, texture->r, texture->g, texture->b, texture->a);
        } else {
            GL_SetColor(data, 255, 255, 255, 255);
        }
    
        GL_SetBlendMode(data, texture->blendMode);
    
        if (texturedata->yuv) {
            GL_SetShader(data, SHADER_YV12);
        } else {
            GL_SetShader(data, SHADER_RGB);
        }
    
        minx = dstrect->x;
        miny = dstrect->y;
        maxx = dstrect->x + dstrect->w;
        maxy = dstrect->y + dstrect->h;
    
        minu = (GLfloat) srcrect->x / texture->w;
        minu *= texturedata->texw;
        maxu = (GLfloat) (srcrect->x + srcrect->w) / texture->w;
        maxu *= texturedata->texw;
        minv = (GLfloat) srcrect->y / texture->h;
        minv *= texturedata->texh;
        maxv = (GLfloat) (srcrect->y + srcrect->h) / texture->h;
        maxv *= texturedata->texh;
    
        data->glBegin(GL_TRIANGLE_STRIP);
        data->glTexCoord2f(minu, minv);
        data->glVertex2f(minx, miny);
        data->glTexCoord2f(maxu, minv);
        data->glVertex2f(maxx, miny);
        data->glTexCoord2f(minu, maxv);
        data->glVertex2f(minx, maxy);
        data->glTexCoord2f(maxu, maxv);
        data->glVertex2f(maxx, maxy);
        data->glEnd();
    
        data->glDisable(texturedata->type);
    
        return GL_CheckError("", renderer);
    }
    Can we drop it now?
    This post contains the official Gleeok seal of approval. Look for these and other posts in an area near you.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Armageddon Games is a game development group founded in 1997. We are extremely passionate about our work and our inspirations are mostly drawn from games of the 8-bit and 16-bit era.
Social